Jeff,
In my opinion, this is a common area of confusion.  The DFTACTGRP(*YES) 
option on the compiler is the cause for the confusion!  The problem is 
the name of that option says 'DFTACTGRP', but it actually does more than 
just control which activation group the program is in.
So, indeed, DFTACTGRP(*YES) and ACTGRP(*CALLER) (where caller is in 
*DFTACTGRP) do not work the same way.
Yes, they will both run in the default activation group.  And, yes, 
there will be no way to reclaim the activation group (since *DFTACTGRP 
cannot be reclaimed.)
And, *INLR=*ON at the end of a program will close all files on the 
F-spec, it will do that no matter what activation group you use, so that 
should go without saying.
But, a program with DFTACTGRP(*NO) will not be "de-activated" (it will 
remain in memory) even if using *CALLER from the *DFTACTGRP.  If it has 
static variables in subprocedures, the variable values will not be 
reset, etc.  In other words, it will work like an ILE program rather 
than an OPM program.  Except that it's in *DFTACTGRP, so it can never be 
reclaimed.
Also, service programs with ACTGRP(*CALLER) called from *DFTACTGRP will 
go haywire if RCLRSC is run.
Thankfully, there is really no good reason to run an ILE program with 
ACTGRP(*CALLER) and call it from *DFTACTGRP, because it does cause these 
problems.
As has been discussed on this list a few times in the past, I really 
wish the DFTACTGRP(*YES) option on the compiler had been called 
OPMCOMPAT(*YES) because, yeah, it does run the program in the default 
activation group, but it also makes it work like an OPM program in other 
ways, such as being de-activated when LR is on, not allowing 
subprocedures, etc.  This would've been much less confusing.
I also wish the OPM activation group had been called *OPMACTGRP or 
*ORIGACTGRP instead of *DFTACTGRP.  Far too many people think "oh, it's 
the default, so it's probably a safe option".  It's not really the 
default (for example, for CRTPGM it is not the default -- either QILE 
is, or *NEW, depending on the language).  Once activation groups were 
added to the OS (V2R3) they needed a place for OPM programs to run... 
calling it "default" was a mistake.
On 10/28/2015 10:37 AM, Jeff Young wrote:
All,
For an ILE program with ACTGRP(*CALLER)  called from *DFTACTGRP, what
activation group does it run in?
If the ILE program is RPGLE and ends with *INLR = *On, do all files get
closed and record locks released?
TIA
Jeff Young
Sr. Programmer Analyst
As an Amazon Associate we earn from qualifying purchases.