SET ABEND EXIT (COBOL)
The SET ABEND EXIT (STAE) statement establishes or cancels linkage to an abend routine to which CA IDMS passes control when the issuing task terminates abnormally. Any program within a task can establish an abend exit. However, only one abend exit is in effect at any given time for each task level. If more than one abend exit has been established, CA IDMS recognizes the exit that is associated with the last STAE request.
idmscu
The SET ABEND EXIT (STAE) statement establishes or cancels linkage to an abend routine to which CA IDMS passes control when the issuing task terminates abnormally. Any program within a task can establish an abend exit. However, only one abend exit is in effect at any given time for each task level. If more than one abend exit has been established, CA IDMS recognizes the exit that is associated with the last STAE request.
When a task terminates abnormally (after a processing error or an ABEND request), abend exits for the program that was executing at the time of the abend and for all higher-level programs are executed before the task is terminated. The program can prevent automatic execution of abend exits by coding the EXITS IGNORED clause in an ABEND request or by coding a DC RETURN request in the abend routine.
Syntax
►►─── SET ABEND EXIT ─┬─ on PROGRAMprogram─┬─ . ────────────────────────────►◄ └─ OFF ────────────────┘
Parameters
- on PROGRAMSpecifies where to transfer control when the issuing task terminates abnormally. Specify the symbolic name of a user-defined field that contains the program name, or the name itself enclosed in quotation marks.CA IDMS does not verify whether the specified program name is valid when the STAE request is issued. If the program is not found or is unloadable when CA IDMS attempts to execute it, the request is ignored.
- OFFCancels any previous STAE request for the issuing task level.
Examples
The following examples illustrate the use of the SET ABEND EXIT statement.
- Example 1The following statement establishes an abend exit that executes the program ABENDRTN when the issuing task terminates abnormally:SET ABEND EXIT ON PROGRAM 'ABENDRTN'.
- Example 2The following statement cancels all abend exits that were previously established at the task level of the issuing program:SET ABEND EXIT OFF.
Status Codes
After completion of the SET ABEND EXIT function, the only possible value in the ERROR-STATUS field of the IDMS-DC communications block is 0000.