CICS - Handle Abend


Advertisements

If a program abends due to some reasons like input-output error, then it can be handled using Handle Abend CICS command. Following is the syntax of Handle Abend command −

Syntax

EXEC CICS HANDLE ABEND
   PROGRAM(name) 
   LABEL(Label)   
   CANCEL         
   RESET
END-EXEC

Program name or label name is used to transfer the control to the program or paragraph if abend occurs. CANCEL is used to cancel previous HANDLE CONDITIONS. RESET is used to re-activate the previously cancelled HANDLE ABEND.

Example

Following is the example of Handle Abend −

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. HELLO.                                               
PROCEDURE DIVISION.

EXEC CICS HANDLE ABEND
    LABEL (X0000-HANDLE-ABEND-PARA)
END-EXEC.

X0000-HANDLE-ABEND-PARA.
DISPLAY 'Program Abended'.
cics_error_handling.htm
Advertisements