Application design errors

A stuck process might be caused by a program logic error.

For example, consider the following scenarios:
Outstanding user events:
  1. One of the activities of the process returns from what it believes to be its final activation. It issues an EXEC CICS RETURN command without the ENDACTIVITY option.
  2. There are no events on the reattachment queue of the activity, but there is a user event in its event pool.
  3. There is no means for the event to be fired. Perhaps it is an input event which has fired, caused reattachment, and been retrieved, but which the activity has neglected to delete.

In this case, the activity becomes dormant, and there is no way for it to reactivated. The process is stuck.

The recommended way to prevent this scenario is to add the ENDACTIVITY option to the EXEC CICS RETURN command that ends the final activation of the activity. Coding RETURN ENDACTIVITY deletes any outstanding events—other than activity completion events for child activities, which the activity must deal with properly—and allows the activity to complete normally.

Waiting for an external interaction:

A user-related activity returns from its initial activation and becomes dormant, waiting for an external interaction to occur. (User-related activities are described in Activity processing.) However, the expected user input does not happen. Perhaps the clerk is sick, or the data required is not available. The process is stuck.

You can recover from this scenario by setting a timer which, if the expected external interaction does not occur within a specified period, causes the activity (or its parent) to be reactivated anyway.

Timer error:
A programming error results in a timer being set to expire in five days rather than 5 minutes. The process is stuck. See Restarting stuck processes.
Note: To force a timer to expire before its specified time, use the FORCE TIMER command.