Home > Ask the AS/400 Experts > Questions & Answers > Closing a RPG program
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Closing a RPG program

Jim Mason EXPERT RESPONSE FROM: Jim Mason

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site
>
QUESTION POSED ON: 12 May 2004
I'm running an original HTTP server and have a CGI program that executes a subprocedure several times, as necessary. This subprocedure, in turn, calls an RPG III program for some calculations. The problem is after the page is displayed, the files from the RPG III program stay open in the job where the CGI program ran. How do I close those files? Changing the RPG III program is not an option as it exists in another system that also uses it.

>
I assume the called CGI program stays active. If the called RPG program does a return, instead of an exit (seton lr), the files in that program in the call stack can remain open. Although it adds some overhead, a simple solution would be to call the RPG program that leaves the files open from another RPG program that does an exit instead of the return. The exit in the calling RPG program forces all sub programs to close completely on the job call stack. That should fix your problem with open files in the called RPG program.

If you want to decide dynamically when to close the files, use a conditional return or exit in the new calling RPG program that calls the RPG subprogram.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

Check out these Best Web Links on Web development.

Ask the Experts yourself: Our Web development gurus are waiting to answer your questions.

Ask your Web development & WebSphere questions -- or help out your peers by answering them--in our WebSphere & Web Development Forum.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts