I am hoping this change would improve system performance, since files no
longer need to be reopened on each call to the same program. I understand
that the FREE operation removes a program from the list of activated
programs frees static storage, and ensures program initialization (first
cycle processing) the next time the program is called.
The RPG reference manual notes that the FREE operation reopens the
program's files and may use additional temporary storage. 'Repeated calls
without closing the program's files in between calls may use enough
temporary storage to degrade the system's performance and ultimately cause
an AS/400 machine check'. (Files in this system do not share open data
paths).
Has anyone had experience with a similar situation? Please help!I am
curious to know if there is some sort of limit on the number of times a
program can be called using FREE and RETURN without negatively affecting
system performance. An alternate solution would also be greatly
appreciated.
Thanks!!!
I have modified programs to do a RETRN instead of setting on LR each
time the subprogram was done. This improved total run time for
batch programs greatly. The only thing I do is pass a flag to tell
the program to seton LR or do the regular processing then RETRN.
The RETRN leaves all files open and all variables as they were when
the RETRN was issued. The only implications that I know of is that
if you don't seton LR those files remain open and if you use an
OVRDBF after the first call to the program, it won't be applied
to the files in the subprogram because they are already opened.
Be careful, however, that the code takes into account that the
variables are not reinitialized (do so manually in the code), and that
your file pointers are still at the last record processed in the
previous call. Make sure you are accounting for this with some sort
of file reset..SETLL or whatever.
ki...@biggs-gilmore.com (Kito Jumanne) wrote:
>Hello,
>I am investigating the RPG/400 op-code FREE. The system I support
>repeatedly calls the same programs in a single job steam. Currently, 'LR'
>is set on when leaving the calling program. I would like to thoroughly
>understand the implications of replacing 'seton LR' with 'FREE' and
>'RETURN'.
>
RCLRSC command will end all called prorgams and close all open files in
the called programs. ie
CALL 'QCMDEXC'
PARM 'RCLRSC' CMD 10
PARM 10 LENGTH 155
Gary W. West (consultant/contract developer - Software Solutions, Inc.)