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

FREE opcode in RPG ILE?

318 views
Skip to first unread message

NKP

unread,
Oct 3, 1996, 3:00:00 AM10/3/96
to

I have been converting som old OPM programs to ILE using CVTRPGSRC, but
when compiling I get an error on the FREE opcode. Is there a similar opcode
in RPG ILE, or should I just remove the line?

Thanks,
Nils Kilden-Pedersen

José Hipólito

unread,
Oct 3, 1996, 3:00:00 AM10/3/96
to

RPG IV doesn't support the FREE operation code. You need to remove it.
But there is a problem when the program called does not have LR turned
*ON. If the program called uses files and you call more than once the
program, the pointers in the files will be in the last records you
read. In addition your variables will not be initialized when the
program is called the 2nd and later times. So, be aware that you have
to check that in the program called when removing the FREE statement rom
the calling program; may be you will need to modify the program called.
:-)

Good luck.

Julian H. Lloyd

unread,
Oct 4, 1996, 3:00:00 AM10/4/96
to

José Hipólito Delfa wrote:
>
> RPG IV doesn't support the FREE operation code. You need to remove it.
> But there is a problem when the program called does not have LR turned
> *ON. If the program called uses files and you call more than once the
> program, the pointers in the files will be in the last records you
> read. In addition your variables will not be initialized when the
> program is called the 2nd and later times. So, be aware that you have
> to check that in the program called when removing the FREE statement rom
> the calling program; may be you will need to modify the program called.
> :-)
<SNIP>

Of course, the other side of this equation is that the system doesn't
suffer the overhead of all the program init/termination and file opens
and closes. Designing your programs to be truly re-entrant is one of the
greatest performance wins available on an AS/400, whether in OPM or ILE.

The TEAMIBM Network

unread,
Oct 4, 1996, 3:00:00 AM10/4/96
to

>I have been converting som old OPM programs to ILE using CVTRPGSRC,
>but when compiling I get an error on the FREE opcode. Is there a
>similar opcode in RPG ILE, or should I just remove the line?

There is no support for the FREE opcode in RPG IV. You could just
remove the line, but then there would be no guarantee that the
application worked as it did before. Check the application to
see why FREE was needed in the first place - if it's really
performing a useful function, then one option is to call the
program that was the target of the FREE request with a parameter
that requests it to set on LR and exit. There are many other
alternatives, including changing the FREEd program to control it's
own initailisation or using ILE activations groups (AGs) to allow
the selective clean up of groups of related programs.

Without knowing the circumstances of why FREE was used, it's hard to
make a recommendation.

Jon Paris - jo...@vnet.ibm.com - AS/400 AD

0 new messages