Académique Documents
Professionnel Documents
Culture Documents
There are three types of activation groups: 1. The default activation group (*DFTACTGRP) 2. Persistent or named activation groups (also called static activation groups) 3. Non-persistent or *NEW activation groups (also called dynamic activation groups) Activation groups are boundaries between running programs/applications within one job. One or more programs can run within an activation group, and there can be one or more activation groups for any job. Activation groups are assigned to each compiled program or service program at compile time, using the ACTGRP parameter of the CRTPGM, CRTSRVPGM, or CRTBNDxxx command. With the exception of the *DFTACTGRP, activation groups are automatically created when a program is called. An activation group name is associated with all program objects. When a program is called, if its associated activation is not active, the system creates the activation group and then loads the program. If the activation group is already activated, the program is loaded immediately. This provides much faster program loading.
While "eligible" may not be a familiar word to the CL language, you will need to get used to it. The following is another example of the RCLACTGRP command:
RCLACTGRP ACTGRP(QILE)
This command will end the QILE activation group, provided all program invocations have returned. An example of where QILE would not end is if QCMD is called from a program that is running within QILE; then, the QILE activation group is not eligible for termination.
ILE APIs
Along with ILE, IBM provided several APIs that perform certain tasks. One API, CEETREC, causes the current activation group to be deactivated, and all programs running in that activation group are terminated. This is effectively the same behavior as the STOP RUN statement in COBOL. The CEETREC API is an ILE procedure, and, therefore, must be called with a bound call operation--either a CALLB or CALLP to a prototype that references CEETREC. RPG IV and CL support bound calls, so they can call CEETREC. In RPG IV, a bound call can be performed with either a prototype call (CALLP) or the CALLB operation code. A prototype call, as the term implies, requires a prototype. While a prototype may be useful for completeness, it isn't necessary to call CEETREC.
C Eval *INLR = *ON C CallB 'CEETREC'
Setting on LR does not impact the results. CEETREC can be called with *INLR on or off. Regardless of the setting, the program is still removed from memory.
Clear as Mud?
Activation groups are complex, and this article only scratches the surface. Use them progressively, adding more to your applications as you become accustomed to using them. And don't feel bad if you don't understand them right away. A group of us were in Rochester, Minnesota, several years ago for an introduction to ILE. We developed a pet name for this new technology; we called them aggravation groups.