Register Activation Group Exit Procedure Last (CEE4RAGEL) API
Required Parameter:
1 | procedure | Input | RAGE_ENTRY2 |
Omissible Parameter:
2 | fc | Output | FEEDBACK |
Service Program Name: QLEAWI
Default Public Authority: *USE
Threadsafe: Yes
The Register Activation Group Exit Procedure Last (CEE4RAGEL) API is used to register procedures that are called when an activation group ends. Activation group exit procedures, registered by CEE4RAGEL, are called after HLL user exit procedures, but before any system level activation group resource clean up takes place. Other APIs that can register activation group exit procedures are CEE4RAGE and CEE4RAGE2. When those APIs are called, the exit procedures are called in the reverse order of their registration. CEE4RAGEL, however, will register the exit procedure so that it is called last, no matter which order the registration took place. The exit procedure that previously would have been called last will now be called just before the exit procedure registered with this API (second to last).
For example, if E1, E2, E3, E4, and E5 are exit procedures registered as follows:
CEE4RAGE2(E1,NULL);
CEE4RAGE2(E2,NULL);
CEE4RAGEL(E3,NULL);
CEE4RAGE2(E4,NULL);
CEE4RAGEL(E5,NULL);
When the activation group ends, the exit procedures will be called in the following order: E4, E2, E1, E3. and E5.
If an exit procedure fails, subsequent exit procedures will not be called. There is no practical limit to the number of exit procedures that can be registered. If the same exit procedure is registered multiple times, it is called multiple times.
Authorities and Locks
None.
Required Parameter
- procedure (input)
- An entry variable or constant for the procedure that is to be called at activation group termination.
Omissible Parameter
- fc (output)
- A 12-byte feedback code.
Feedback Codes and Conditions
CEE0000 | The API completed successfully |
Severity: 00 | |
CEE0257 | The procedure provided for &1 is not valid |
Severity: 30 | |
CEE3103 | Cannot allocate storage in &1 |
Severity: 30 | |
CEE3111 | &1 cannot be called at this time |
Severity: 30 | |
CEE9902 | Unexpected user error occurred in &1 |
Severity: 30 |
Usage Notes
-
The message CEE0257 occurs if procedure is not a procedure pointer, or if the procedure identified by procedure is not in either the current activation group or the default activation group.
-
Once the activation group exit procedures start to run, the register activation group exit APIs (CEE4RAGE, CEE4RAGE2, and CEE4RAGEL) cannot be called.
Interface to the Activation Group Exit Procedure
An activation group exit procedure is called when the activation group is ended. The procedure is coded as activation_group_exit with the following parameters.
Required Parameter Group:
1 | ag_mark | Input | UINT8 |
2 | reason | Input | UINT4 |
3 | result_code | I/O | UINT4 |
4 | user_rc | I/O | UINT4 |
Authorities and Locks
None.
Required Parameter Group
- ag_mark (input)
- The activation group mark that uniquely identifies the activation group within the job.
- reason (input)
- The reason for the activation group being ended. See Common Reason Codes for Ending Activation Groups and Call Stack Entries for a description of the reason codes.
- result_code (I/O)
- The value passed as input is the action to be taken as specified by a previous exit procedure. The value passed to the first exit procedure is 0. The output value can specify an action to be taken. If the result code does not match any of the following actions, the output value is ignored and the previous action remains unchanged.
-
- No action
-
0 Do not change the action. - Recover
-
10 Do not perform any pending error requests. This is used if a previous exit procedure specified a result code of 20 and a subsequent procedure recovers from the error. The message CEE9901, indicating an application error, is not sent. - Failure
-
20 Send message CEE9901 to the caller of the control boundary after the remaining exit procedures are called. 21 Send message CEE9901 to the caller of the control boundary. The remaining exit procedures registered by the CEE4RAGE API are not called. This is used if an unrecoverable error occurs in the exit procedure requesting this action.
Note: The application error message CEE9901 is sent after the activation group resources of the system are taken down and the activation group has ended.
- user_rc (I/O)
- The value passed as input is the user_rc returned as output from the previous exit procedure. The value passed to the first exit procedure is 0.
Common Reason Codes for Ending Activation Groups and Call Stack Entries.
Bit | Description |
---|---|
Bits 0 | Reserved |
Bits 1 | Call stack entry is canceled because an exception message was sent. |
Bits 2-15 | Reserved |
Bit 16 | 0 - normal end 1 - abnormal end |
Bit 17 | Activation Group is ending. |
Bit 18 | Initiated by the Reclaim Activation Group (RCLACTGRP) command. |
Bit 19 | Initiated as a result of the job ending. |
Bit 20 | Initiated by an exit verb, for example exit() in C, or the CEETREC API. |
Bit 21 | Initiated by an unhandled function check. |
Bit 22 | Call stack entry canceled because of an out-of-scope jump, for example longjmp() in C. |
Bits 23-31 | Reserved (0) |
API introduced: V7R1 with PTF
[ Back to top | ILE CEE APIs | APIs by category ]