ga
2007-01-18 20:24:22 UTC
I have some questions regarding "RETRN" coding in an RPG/400 program.
I have a PROGRAM that calls either PROGRAMA or PROGRAMB
Both PROGRAMA and PROGRAMB may call PROGRAMC with 4 variables, IMMI,
IMP#, IMD1 and IMD2.
PROGRAMC opens a very large file (1.6gb) and maintains an index.
Right now PROGRAMC ends with "seton LR". I would like to change that
to "RETRN" to avoid the opening/closing file overhead because on one
screen in PROGRAMB, it might call PROGRAMC 24 times. Opening and
closing the file each time has to be a lot of overhead.
Questions:
1. Assuming I call PROGRAMC from PROGRAMB, and I "RETRN" at the end
of my logic in PROGRAMC, when I call PROGRAMC again from PROGRAMB does
it reinitialize the parms I pass on the subsequent call . For
instance, the first time I Call it, IMMI, IMP#, IMD1 and IMD2 are all
different than the second time I call it. I want to make sure it uses
the new values on the subsequent call. On the subsequent call, does
it start at the *ENTRY PLIST point or at "RETRN"?
2. When does PROGRAMC truly end? When I end PROGRAMA or PROGRAMB
will it close the files used by PROGRAMC and end PROGRAMC as well?
3. If PROGRAMB calls PROGRAMD, which also calls PROGRAMC, is that a
problem?
4. Assuming PROGRAM calls PROGRAMA and then the next time calls
PROGRAMB, do each of the programs have a separate version of PROGRAMC
in memory that they are using? If other users call PROGRAMC from
another program, I assume they have their own separate version of
PROGRAMC and variables as well?
The limited testing I've done would indicate that each subsequent call
does in fact start at the *ENTRY PLIST Point and processes the new
values in the parms. It also appears that if I close PROGRAMB or
PROGRAMA, it closes the version of PROGRAMC it is using along with the
files. Am I missing something or is this essentially the way it
works?
thanks!
George Applegate
***@fscoop.com
I have a PROGRAM that calls either PROGRAMA or PROGRAMB
Both PROGRAMA and PROGRAMB may call PROGRAMC with 4 variables, IMMI,
IMP#, IMD1 and IMD2.
PROGRAMC opens a very large file (1.6gb) and maintains an index.
Right now PROGRAMC ends with "seton LR". I would like to change that
to "RETRN" to avoid the opening/closing file overhead because on one
screen in PROGRAMB, it might call PROGRAMC 24 times. Opening and
closing the file each time has to be a lot of overhead.
Questions:
1. Assuming I call PROGRAMC from PROGRAMB, and I "RETRN" at the end
of my logic in PROGRAMC, when I call PROGRAMC again from PROGRAMB does
it reinitialize the parms I pass on the subsequent call . For
instance, the first time I Call it, IMMI, IMP#, IMD1 and IMD2 are all
different than the second time I call it. I want to make sure it uses
the new values on the subsequent call. On the subsequent call, does
it start at the *ENTRY PLIST point or at "RETRN"?
2. When does PROGRAMC truly end? When I end PROGRAMA or PROGRAMB
will it close the files used by PROGRAMC and end PROGRAMC as well?
3. If PROGRAMB calls PROGRAMD, which also calls PROGRAMC, is that a
problem?
4. Assuming PROGRAM calls PROGRAMA and then the next time calls
PROGRAMB, do each of the programs have a separate version of PROGRAMC
in memory that they are using? If other users call PROGRAMC from
another program, I assume they have their own separate version of
PROGRAMC and variables as well?
The limited testing I've done would indicate that each subsequent call
does in fact start at the *ENTRY PLIST Point and processes the new
values in the parms. It also appears that if I close PROGRAMB or
PROGRAMA, it closes the version of PROGRAMC it is using along with the
files. Am I missing something or is this essentially the way it
works?
thanks!
George Applegate
***@fscoop.com