An activation group is a substructure of a job and consists of system resources (for example, storage, commitment definitions, and open files) that are allocated to run one or more ILE or OPM programs. Activation groups make it possible for ILE programs running in the same job to run independently without intruding on each other (for example, commitment control and overrides). The basic idea is that all programs activated within one activation group are developed as one cooperative application.
You identify the activation group that your ILE program will run in at the time of program creation. The activation group is determined by the value specified on the ACTGRP parameter when the program object was created. (OPM programs always run in the default activation group; you cannot change their activation group specification.) Once an ILE program (object type *PGM) is activated, it remains activated until the activation group is deleted.
The remainder of this section tells you how to specify an activation group and how to delete one. For more information on activation groups, refer to ILE Concepts.
Specifying an Activation Group
You control that activation group your ILE program will run in by specifying a value for the ACTGRP parameter when you create your program (using CRTPGM or CRTBNDRPG) or service program (using CRTSRVPGM).
Note: If you are using the CRTBNDRPG command, you can only specify a value for ACTGRP if the value of DFTACTGRP is *NO.
You can choose one of the following values:
Running in the OPM Default Activation Group
When an OS/400 job is started, the system creates an activation group to be used by OPM programs. The symbol used to represent this activation group is *DFTACTGRP. You cannot delete the OPM default activation group. It is deleted by the system when your job ends.
OPM programs automatically run in the OPM default activation group. An ILE program will also run in the OPM default activation group when one of the following occurs:
Note: The resources associated with a program running in the OPM default activation group via *CALLER will not be deleted until the job ends.
Maintaining OPM RPG/400® and ILE RPG Program Compatibility
If you have an OPM application that consists of several RPG programs, you can ensure that the migrated application will behave like an OPM one if you create the ILE application as follows:
Deleting an Activation Group
When an activation group is deleted, its resources are reclaimed. The resources includestatic storage and open files. A *NEW activation group is deleted when the program it is associated with returns to its caller.
Named activation groups (such as QILE) are persistent activation groups in that they are not deleted unless explicitly deleted or unless the job ends. The storage associated with programs running in named activation groups is not released until these activation groups are deleted.
An ILE RPG program created DFTACTGRP(*YES) will have its storage released when it ends with LR on or abnormally.
Note: The storage associated with ILE programs running in the default activation group via *CALLER is not released until you sign off (for an interactive job) or until the job ends (for a batch job).
If many ILE RPG programs are activated (that is called at least once) system storage may be exhausted. Therefore, you should avoid having ILE programs that use large amounts of static storage run in the OPM default activation group, since the storage will not be reclaimed until the job ends.
The storage associated with a service program is reclaimed only when the activation group it is associated with ends. If the service program is called into the default activation group, its resources are reclaimed when the job ends.
You can delete a named activation group using the RCLACTGRP command. Use this command to delete a nondefault activation group that is not in use. The command provides options to either delete all eligible activation groups or to delete an activation group by name.
Reclaim Resources Command
The Reclaim Resources (RCLRSC) command is designed to free the resources for programs that are no longer active. The command works differently depending on how the program was created. If the program is an OPM program or was created with DFTACTGRP(*YES), then the RCLRSC command will close open files and free static storage.
For ILE programs or service programs that were activated into the OPM default activation group because they were created with *CALLER, files will be closed when the RCLRSC command is issued. For programs, the storage will be re-initialized; however, the storage will not be released. For service programs, the storage will neither be re-initialized nor released.
Note: This means that if you have a service program that ran in the default activation group and left files open (returning with LR off), and a RCLRSC is issued, when you call the service program again, the files will still appear to be open, so so any I/O operations will result in an error.
For ILE programs associated with a named activation group, the RCLRSC command has no effect. You must use the RCLACTGRP command to free resources in a named activation group.
|
|
IBM - RPG Related Tutorials |
|
---|---|
IBM-ILE Tutorial | IBM DB2 Tutorial |
SQL Database Tutorial |
IBM - RPG Related Interview Questions |
|
---|---|
IBM-ILE Interview Questions | IBM Informix Interview Questions |
IBM DB2 Interview Questions | SQL Database Interview Questions |
IBM AIX Interview Questions | SQL Interview Questions |
AS400 Interview Questions | DB2 SQL Programming Interview Questions |
IBM Integration Bus Interview Questions | Synopsys Interview Questions |
Rpgle Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.