Netting it out: activation groups for the rest of us
Posted by Reeve on March 20, 2008
Why do some overrides not work, like OVRDBF FRP001 SHARE(*YES), when I compile an RPG program? Because activation groups work like “sub-jobs”; AG’s give you the ability to control overrides for different programs running within the same job. So, if the calling program (CL or otherwise) is running in *DFTACTGRP and you carelessly compile an ILE RPG program with the QILE activation group, overrides won’t work.
One solution is to set your overrides with OVRSCOPE(*JOB). If you check the default for that OVRDBF parameter, you’ll find it’s *ACTGRPDFN; this works fine if everything is compiled with the same activation group. OVRSCOPE(*JOB) means “this override applies at the job and regardless of the activation group.” *CALLER means “run this program in the same activation group as the program that called it.” So, OVRSCOPE(*ACTGRPDFN) usually works for *CALLER…but QILE is a different activation group, and the override doesn’t apply.
Here’s the bottom line: IBM made a huge error by setting QILE as the default activation group in the CRTBNDRPG command-it should have been *CALLER. Using *CALLER preserves existing behavior; using QILE doesn’t.My solution is to use XXM767 (my standard object creation program) for all compiles and object creation. It’s a poor solution but it’s a standard and therefore far better than hand-compiling.
There’s another solution: include an “H”-spec copybook with DFTACTGRP(*NO) ACTGRP(*CALLER); these parameters will override the compile defaults. Of course, CL doesn’t support copy books, and commands don’t support external references (for parameter attributes).
In the real world, with source code control and where you do a build every day and drop everything when the build breaks, problems like this go away. Unfortunately, most AS/400 shops (I’m trying very hard not to offend anybody!) haven’t recognized the value of a formalized process for managing the journey of source code from the developer to the production environment. The fact that IBM hasn’t provided this key component of a well-rounded and fully-realized system is a shame.
