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


  • Subject: Re: OP code in RPGIII called 'FREE'
  • From: "R. Bruce Hoffman, Jr." <rbruceh@xxxxxxx>
  • Date: Wed, 10 Feb 1999 18:02:56 -0500



Mary Koetting wrote:

> We have an old program with a statement 'FREE....' . According to the help,
> it 'deactivates a program'. Does anyone know if there is another opcode that
> I can use to substitute for 'FREE' or maybe it is no longer necessary and
> that is why it is not valid in RPGLE.

Well, activation groups control the activation of a program in ILE.  To
understand this, you need to know that a program is activated when first called,
and invoked.  As long as the program remains active, any further calls just
invoke the program.  Static storage stays put.  Thus, when you call the rpg
program again, the indicators in that program remain as they were when the
program last returned.

>  C                     MOVE *ZEROS    ERRSEV
>  C                     CALL PROGNO                 62
>  C*
>  C                     FREE PROGNO                 62

Note that the called program is a variable not a static, quoted reference.  
Hence
the coding.  However, there is not enough information to go on.  The programmer
probably decided the same thing.  Without knowing if the called program sets on
LR before it exits, the FREE operation will terminate that activation regardless
of the programmer's intent in the called program.

Put another way, the programmer of this calling program wants to insure that the
called program does not "hang around" after it is invoked from this interactive
program that will "hang around" for a long time.  Keeps the PAG short.

Now, can you eliminate it in ILE?  Yup, but only if the called programs all run
in a different activation group than the calling program and if that activation
group is cleaned up after the call.

Should you elimate this...  hhhhhmmmmmmmmm...  If your intent is to convert
everything to a true ILE environment, yup, start removing.  But just make sure
that your architecture is sound for the new environment and don't keep crossing
from OPM to ILE and back.

b.

> -

===========================================================
R. Bruce Hoffman, Jr. -- IBM Certified AS/400 Administrator

-- The sum of all human knowledge is a fixed constant.
    It's the population that keeps growing!


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.