Hello Jon,

Am 10.08.2025 um 18:37 schrieb Jon Paris <jon.paris@xxxxxxxxxxxxxx>:

*NEW as a default? That's pretty scary.

Why?

This is a lesson I've learned in my early days of OS/400 programming experience in probably early 2008. On e. g. Linux, if a process ends, nothing is retained. One can start the application a thousand times and it behaves the same each time.
On OS/400 with compiler defaults — dftactgrp(*yes) —, I ran into mysterious errors, happening because programs end but somehow retained state, while I assumed things being reset. Little did I know about LR back then. Reading a bit about AGs, and using a new AG which gets discarded at program end solved the issue for me thoroughly.

And it stuck.

Some context: The absolute majority of programs I develop and use are interactive 5250. They get started by hand from a menu and they end when I press F3. Most often, I open them just once per sign-on. No fancy calling of external programs in tight loops, etc.

Unusual? Maybe. Scary? No.

After learning some more about the multiple meanings of LR in ILE context, I now use actgrp(*caller) on sub-programs being called from such an interactive application, and set LR to on upon returning to the caller to save some wait time. Keep in mind that my main machine is a 150. Something most of the professionals in here won't even touch with a pincer. Believe me, I take good care about efficient application design. As a necessity. And as a personal challenge. :-)

There are still some open questions about AGs. What exactly is retained, the precise meaning of LR, the difference of setting it on at program entry, vs. setting it on at program end, etc. Most of them might be answered when I take my time to read the ILE Concepts manual for the n'th time. For n being about 5 or even 6.

Coming from Linux, AGs seem very alien. But I understand the motivation for their invention.

Does that help in understanding the scare? :-)

:wq! PoC



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2025 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.