Error Handling


CICS commands can cause errors during the application program execution.The program execution might abend due to the error that causes the task incomplete. These errors need to be handled to continue the program execution.CICS provides default error handling to handle some expected errors. When a condition is raised, the below are the four different ways of doing something to handle them -

  • Letting the program continue - Allowing control to return from CICS to the next instruction in the program following the EXEC CICS command that has just executed. The below are three ways of doing this -
  • Pass control to a specified label - This can be done if a named condition arises.
    The below are two ways of passing control to a specified label –
    • EXEC CICS HANDLE CONDITION ERROR (label) command.
    • EXEC CICS HANDLE CONDITION condition-name (label) command, where condition-name is the name of an exceptional condition.
  • Do nothing and rely on the CICS system default action - This option is perfectly sensible option in some cases and means do nothing by way of testing or handling conditions. The CICS default action is normally to abend the task but not always.
  • Mix the methods in any way based on requirement.

CICS provides various commands to identify and handle the errors in the application program. Below are the list of error handling commands in cics –

Command Description
Handle Condition Used to specify the control passing label or paragraph if a specified condition occurs.
Ignore Condition Used to specify that no action is taken if a specified condition occurs.
Push Handle Used to suspend the current effect of the HANDLE CONDITION, IGNORE CONDITION, HANDLE ABEND and HANDLE AID commands.
Pop Handle Used to restore the current effect of the HANDLE CONDITION, IGNORE CONDITION, HANDLE ABEND and HANDLE AID commands to the before state a PUSH HANDLE command was executed at the current link level.

Below are the list of abend support commands in cics –

Command Description
Abend Terminates a task abnormally
Handle Abend Used to activate, cancel or reactivate an exit for abnormal termination processing.