Using the ENDACTIVITY option of the RETURN command
You can use the ENDACTIVITY option of the EXEC CICS RETURN command to signal that an activity program has completed all of its processing steps and is not to be reactivated.
About this task
Optionally, an activity program can use the ENDACTIVITY option of the EXEC CICS RETURN command to signal that it has completed all its processing steps and should not be reactivated. One advantage of using ENDACTIVITY is that the activity program does not have to bother about deleting user events—other than activity completion events—from its event pool before completing; the events are deleted automatically by CICS.
- If there are no user events in the event pool of the activity
- The activity completes normally.
- If there are user events, fired or unfired, in the event pool of the activity
-
- If one or more of the events are activity completion events, the activity abends. Trying to force an activity to complete before it has dealt with one or more of its child activities is a program logic error.
- If none of the events are activity completion events, the events are deleted and the activity completes normally.
It is recommended that you issue a RETURN ENDACTIVITY command at the end of the final activation of an activity, as a way of ensuring that the activity completes. For example, if, through a program logic error, an activity returns from what it believes to be its final activation with an unfired event in its event pool, it is possible that the activity could go dormant forever, and never complete. Coding RETURN ENDACTIVITY deletes the event and forces the activity to complete.