Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RPG/400 op-code FREE

104 views
Skip to first unread message

Kito Jumanne

unread,
Sep 10, 1996, 3:00:00 AM9/10/96
to

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'.

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!!!

wtho...@madisn.k12.wi.us

unread,
Sep 10, 1996, 3:00:00 AM9/10/96
to

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'.

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.

Cindi

unread,
Sep 14, 1996, 3:00:00 AM9/14/96
to

I would also advocate the use of RETRN in this case, as the files
would remain open, and should decrease processing time substantially.

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'.
>

GaryWWest

unread,
Sep 14, 1996, 3:00:00 AM9/14/96
to

I have had better luck placing a return in my programs rather than setting
on *INLR, but instead of using the FREE op code, I call the command RCLRSC
in either the CL that calls the first RPG program, or in the first RPG
that is called.

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.)

0 new messages