Creating a program-level abend program or routine

You can create a program-level abend program. For some programming languages, you can create a program-level abend routine.

Program-level abend program

You can define an abend program by using RDO or by using the program autoinstall exit.

If you use the autoinstall method, the program definition is not available at the time of the HANDLE ABEND. This might mean that a program functions differently the first time it is invoked. If the program is not defined at the time the HANDLE ABEND is issued, and program autoinstall is active, the security check on the name of the program is the only one which takes place. Other checks occur at the time the abend program is invoked. If the autoinstall fails, the task abends APCT and control is passed to the next higher level.

Abend exit programs can be coded in any supported language.

On entry to an abend exit program, no addressability can be assumed other than that normally assumed for any application program coded in that language.

Program-level abend routine

Restriction: This section does not apply to C, C++, PL/I, and AMODE(64) applications, because the HANDLE ABEND LABEL command is not supported.

Abend exit routines must be coded in the same language as their program.

For abend exit routines, the addressing mode and execution key are set to the addressing mode and execution key in which the HANDLE ABEND command has been issued.

On entry to an abend exit routine, the register values are as follows:
COBOL
Control returns to the HANDLE ABEND command with the registers restored; a COBOL GOTO is then executed.
Assembler (but not AMODE(64) assembler)
Reg 15
Abend label.
Reg 0-14
Contents at the time of the last CICS® service request.

Termination of processing

You can terminate processing in an abend exit routine or program in one of the following ways. When abend routines and programs are called by CICS internal logic, they should terminate with an abend because further processing will probably cause more problems.
  • Use a RETURN command to indicate that the task continues to run with control passed to the program on the next higher logical level. If no such program exists, the task is terminated normally, and any recoverable resources are committed.
  • Use an ABEND command to indicate that the task is abnormally terminated with control passed either to an abend exit specified for a program on a higher logical level or, if there is not one, to the abnormal condition program for abnormal termination processing.
  • Branch to retry an operation. When you use this method to retry an operation, and you want to reenter the original abend exit routine or program if a second failure occurs, the abend exit routine or program should issue the HANDLE ABEND RESET command before branching. This is because CICS has disabled the exit routine or program to prevent it from reentering the abend exit.

For an abend that is caused by a timeout on an outstanding RECEIVE command, it is important to let the CICS abend continue, so that CICS can cancel the RECEIVE.