Abend command is used to terminate the task intentionally. Using Abend command, we can set a user-defined abend code. Following is the syntax of Abend command −
EXEC CICS ABEND ABCODE(name) END-EXEC.
The following example shows how to use the Abend command in a program. It will abend when the program reaches this paragraph with the user-defined abend code. In the following example, it will abend with abend code D100 −
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. EXEC CICS ABEND ABCODE(D100) END-EXEC.