×
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.
Great answer +1
Should be added to a tutorial.
Simple and precise writing +1
-----Original Message-----
From: rpg400-l-bounces+bhopkins=pfgc.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+bhopkins=pfgc.com@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Thursday, November 03, 2011 6:48 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Files open in service programs
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.