RPGLE Activation Groups Reference

An activation group is the part of a job in which ILE programs and service programs run and keep their resources. The ACTGRP and DFTACTGRP values decide which group an object uses, when that group is created, and when it is deleted. This page is the lookup for those values by create command, what a group holds, how a group ends, and how RCLACTGRP works.

It owns the values and the rules. For the idea of runtime scope and the call stack, read IBM i Activation Groups and Call Stack Explained. For design advice across a whole application, read IBM i ILE Binding, Activation Groups, and Service Programs in 2026.

What an activation group holds

IBM: all ILE programs and service programs are activated within a substructure of a job called an activation group. It holds:

  • static program variables,
  • dynamic storage,
  • temporary data management resources: open files (open data paths), commitment definitions, local and remote SQL cursors, the hierarchical file system, the user interface manager, query management instances, open communications links and CPI communications, and
  • certain types of exception handlers and ending procedures.

When an activation group is deleted, the resources it holds are returned. Open resources are closed by the system, and storage that was not deallocated is returned. There is no create-activation-group command. A group is created when an object that names it is first needed.

Values by create command

CommandParameterValuesDefault
CRTBNDRPGDFTACTGRP*YES, *NO*YES
CRTBNDRPGACTGRP*STGMDL, *NEW, *CALLER, a name*STGMDL
CRTPGMACTGRP*ENTMOD, *NEW, *CALLER, a name*ENTMOD
CRTSRVPGMACTGRP*CALLER, a name*CALLER
UPDPGM, UPDSRVPGMACTGRPChanges the group an existing object uses

In RPGLE source, the control keywords DFTACTGRP(*YES | *NO) and ACTGRP(*NEW | *CALLER | name) do the same job for CRTBNDRPG. DFTACTGRP is valid only with CRTBNDRPG.

ctl-opt dftactgrp(*no) actgrp('REFDEMO');      named group
ctl-opt dftactgrp(*no) actgrp(*new);           new group on every call
ctl-opt dftactgrp(*no) actgrp(*caller);        the caller's group
ctl-opt dftactgrp(*yes);                       the default activation group (OPM style)

DFTACTGRP

ValueMeaning
*YESThe program runs in the default activation group, where OPM programs run. RPG behaves like OPM in file sharing, file scoping, RCLRSC and unmonitored exceptions. ILE static binding is not available. You cannot use BNDDIR, ACTGRP or STGMDL, and every call in the source must call a program, not a procedure
*NOThe program uses the group from ACTGRP, and static binding is allowed

If a free-form ctl-opt is present and it names ACTGRP, BNDDIR or STGMDL, DFTACTGRP(*NO) is assumed. Otherwise the command value is used. A new CRTBNDRPG program therefore needs DFTACTGRP(*NO) if it calls a service program, unless the control specification already implies it.

What each value means

ValueGroupCreatedDeleted
A name (user-named)Shared by every object that names itWhen first needed, in the jobStays after a normal return. RCLACTGRP removes it when it is not in use
*NEW (system-named)A new group each time the program is called. The name is unique in the job and never matches a user nameOn every callA normal return from the oldest call stack entry of the group deletes it
*CALLERThe group of the caller. No new group is ever createdNeverWith the caller’s group
*ENTMOD (CRTPGM only)Chosen from the entry module. RPGLE, CBLLE and CLLE modules get QILE with *SNGLVL storage and QILETS with *TERASPACE. Other module types get *NEW

Notes:

  • *NEW is not supported for a service program.
  • No two activation groups in a job can have the same name.
  • All objects that name the same group are developed as one cooperative application, as IBM puts it.

The default activation groups

When a job starts, the system creates two activation groups for OPM programs: one for application programs and one for operating system programs. They cannot be deleted, and the system deletes them when the job ends.

An ILE program or service program can run in them only if all of these hold:

  • It was created with ACTGRP(*CALLER) or with DFTACTGRP(*YES). DFTACTGRP(*YES) exists only on CRTBNDRPG and CRTBNDCL.
  • The call comes from the OPM default activation groups.
  • It does not use the teraspace storage model.

Static and heap storage used there is not returned until the job ends, and data management resources are normally scoped to the job. Open files, for example, are normally not closed until the job ends.

When an activation group ends

What happensEffect on a named groupEffect on a *NEW group
A normal return from the oldest call stack entry of the groupGroup stays in the jobGroup is deleted
HLL end verbs (for example exit() in C), the CEETREC API, or an unhandled exceptionGroup is deleted, if the nearest control boundary is the oldest call stack entry of the group (a hard control boundary)Same
The nearest control boundary is not the oldest entry (a soft boundary)Control moves to the entry before the boundary, and the group is not deletedSame
RCLACTGRPDeletes the named group, if it is not in useNot applicable, because it cannot be named

A control boundary is a call stack entry that marks a boundary of your application. ILE defines one whenever you call between activation groups. IBM explains that a system-named group is deleted on a normal return because it can never be reused, since you cannot name it.

Commitment control when a group ends

IBM’s rules apply to a commitment definition scoped to the activation group (the default scope when STRCMTCTL is used, see Resource scope), and only when the group ends while the job is not ending:

How the group endsPending changes in an activation-group-level commitment definition
Normally, with no errors closing the files under commitment controlThe system performs an implicit commit
Abnormally, or with errors closing files opened under commitment control scoped to the groupThe system performs an implicit rollback

This does not apply to a job-scoped commitment definition (*JOB) or the default activation group’s definition (*DFTACTGRP). IBM says an implicit commit or rollback is never performed for them at activation group end, because they are never ended by an activation group ending. They end with ENDCMTCTL or when the job ends. Files scoped to the group are closed before the implicit commit, so buffered records are written first.

RCLACTGRP

RCLACTGRP deletes an activation group and frees the resources scoped to it.

ParameterValues
ACTGRP*ELIGIBLE for every eligible group in the job, or a group name
OPTIONDefault *NORMAL. It decides whether pending changes of an activation-group-level commitment definition are committed (*NORMAL, if closing files raises no errors) or rolled back (*ABNORMAL), and which close notification is sent for mixed, communications, BSC and ICF files. IBM says it is ignored for all other files and objects in the group
RCLACTGRP ACTGRP(REFDEMO)

On IBM i V7R5M0, after a program with ACTGRP('REFDEMO') had run and returned, this command reported Activation group REFDEMO deleted. A second identical call reported Activation group REFDEMO not found.

A group is eligible only if it meets all of these:

  1. It is not the default activation group.
  2. It is not active, which means no programs are running in it.
  3. It is not a debug activation group.
  4. It is not a shared activation group.

IBM says the command is not threadsafe and fails in a job that allows multiple threads, and that it should normally be used only in the controlling program of an application, to avoid unpredictable results.

Resource scope

The data management resources that a group holds are scoped at one of three levels.

ScopeShared withDefault for
CallThe call stack entry that created the resourceUsually, programs in the default activation group
Activation groupOnly programs in that groupMost data management resources of ILE procedures not in a default group
JobEvery ILE and OPM program in the jobA resource created with job scope

IBM’s example: a file opened with SHARE(*YES) can be used by any procedure in the same group. A second open of that file in a different group creates a second open data path.

For commitment control, the default scope of a commitment definition is the activation group of the program that issued STRCMTCTL. The default activation groups share one commitment definition. For the transaction design that follows, read IBM i Commitment Control and Transaction Management.

Choosing a value

SituationValue to look atWhy
A utility service program shared by many callersCRTSRVPGM ACTGRP(*CALLER)It runs in the caller’s group and shares that group’s files and commitment definition. This is the default
A service program that must keep its own state, files or commitment scopeACTGRP(name)IBM lists a separate address space for variables, separate data management resources and protection from accidental sharing of open files
A program whose resources should be cleaned up on every callACTGRP(*NEW) on the programThe group is deleted on a normal return
Calling a service program from CRTBNDRPGDFTACTGRP(*NO)Static binding is not available with *YES

With *CALLER, IBM notes that unhandled exceptions in the service program reach the client program, and that HLL end verbs in the service program can affect the caller’s group.

Common mistakes

  • Leaving DFTACTGRP(*YES) on a program that needs a service program or binding directory.
  • Naming ACTGRP(*NEW) for a service program.
  • Expecting a named group to disappear when the program returns.
  • Calling RCLACTGRP for a group that still has programs on the call stack.
  • Expecting open files to close at return in the default activation group.
  • Assuming a *NEW program’s pending changes are rolled back when it returns. For an activation-group-level commitment definition, IBM says a normal end commits them and an abnormal end rolls them back. A job-scoped definition is neither committed nor rolled back by the group ending.
  • Using RCLACTGRP in a multithreaded job.

FAQ

What is an activation group in IBM i?

A substructure of a job in which ILE programs and service programs run. It holds their static variables, dynamic storage and temporary data management resources such as open files and commitment definitions.

What is the difference between NEW and CALLER?

*NEW creates a new group every time the program is called, and deletes it on a normal return. *CALLER creates no group and uses the caller’s.

What does DFTACTGRP(*NO) do?

It lets CRTBNDRPG use the activation group named by ACTGRP and allows static binding to service programs. DFTACTGRP(*YES) runs the program in the default activation group and forbids binding directories, ACTGRP and STGMDL.

How do I end a named activation group?

Use RCLACTGRP, once no program in it is active. A hard control boundary with an end verb, CEETREC or an unhandled exception also deletes it.

Summary

  • An activation group holds static storage, dynamic storage, open files, commitment definitions and other resources, and returns them when it is deleted.
  • Defaults differ by command: CRTBNDRPG DFTACTGRP(*YES), CRTPGM ACTGRP(*ENTMOD), CRTSRVPGM ACTGRP(*CALLER).
  • *NEW creates a group per call and deletes it on normal return. A named group stays until RCLACTGRP or a deleting end.
  • *NEW is not available for service programs.
  • Related: the RPGLE Service Programs Reference, the RPGLE Modules and NOMAIN Reference and the RPGLE Binding Directories Reference.

Sources: IBM i 7.5 ILE Concepts (Activation Group, Activation Group Creation, Default Activation Groups, Non-Default Activation Group Deletion, Data Management Scoping, Commitment Control Scoping), the IBM i 7.5 ILE RPG Reference (DFTACTGRP) and the IBM i 7.5 command pages for RCLACTGRP, CRTPGM, CRTSRVPGM and CRTBNDRPG. Nothing on this page has been compiled or run.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top