× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2011/11/3 2:31 PM, James Lampert wrote:
Question that could take me all day to answer empirically:

If an RPG program calls a service program that leaves files open,
then the program ends with SETON LR, should the files opened in the
service program remain open, within the job that called the program?


It's not just files in a service program that would be left open. Files in other modules of the program would also be left open.

RPG modules are standalone. If a program (or service program) has several modules that use the RPG cycle, each module has its own LR. Setting on LR in the main procedure of the program-entry module only affects that module.

Files get opened when the first procedure in the module gets called, or if they are USROPN, when there is an OPEN for them.

Files get closed by
- a CLOSE opcode
- activation group ending
- the cycle-main procedure in the same module ending with LR on or ending abnormally



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.