Previous Topic: #SNAPNext Topic: @STORE


#STAE

The #STAE (system task abend exit) statement establishes or cancels linkage to an abend routine. Control passes to the abend routine if the issuing task terminates abnormally. Any program in a task can establish a #STAE exit; only one abend exit can be in effect at any given time for each task level. If more than one abend exit has been established, the system recognizes the last #STAE request issued.

A task can terminate abnormally following a processing error or on request by an #ABEND function. Abend exits for the program that is executing at the time of the abend and for all higher level programs are executed before the task is terminated. You can override the automatic execution of abend exits by including an #ABEND function in the program or by including a #RETURN function in the abend routine.

Note: A #STAE command issued with no parameters cancels any previously issued #STAE. For further information see STAE Exits.

Syntax

►►─┬─────────┬─ #STAE ────────────────────────────────────────────────────────►
   └─ label ─┘

 ►─┬───────────────────────────────────────┬──────────────────────────────────►◄
   ├─ PGM=program-name-pointer ────────────┤
   └─ EPADDR=entry-point-address-register ─┘

Parameters

PGM=

Specifies whether linkage is established to another program or to an abend routine in the issuing program.

program-name-pointer

Identifies the 1- to 8-character name of the program. Program-name-pointer is a register that points to a field that contains the program name, the symbolic name of a user-defined field that contains the program name, or the program-name literal enclosed in quotation marks.

Note: The DC/UCF system does not test whether the specified program name is valid when the #STAE request is issued. If the program is not found or is otherwise unloadable when the system attempts to execute it, the #STAE request will be ignored.

EPADDR=

Identifies the abend entry-point address of an abend routine in the issuing program. The named routine must have a separate entry point in the program.

entry-point-address-register

Either a register or the symbolic name of a fullword user-defined field that contains the entry-point address.

Example

The #STAE statement shown below establishes a link to the abend routine ABRT02. The program ABRT02 receives control in the event of an abnormal termination of the issuing task.

#STAE PGM=ABRT02

Status Codes

The #STAE instruction is unconditional; any error detected during execution results in an abend of the issuing task.