• Aucun résultat trouvé

ABEND - Abnormally Terminate a Task

Dans le document ana Macro Instructions (Page 114-117)

The ABEND macro instruction is used to initiate error processing for a task. ABEND can request a full or tailored dump of virtual storage areas and control blocks pertaining to the tasks being abnormally terminated, and can specify that the entire job step is to be abnormally terminated. Before the task is terminated, an ESTAE exit gets control. This exit may recover the task and allow it to retry.

If the job step task is abnormally terminated or if ABEND specifies job step termination, the completion code is recorded on the system output device, and the remaining job steps in the job are either skipped or executed as specified in their job control statements.

If the job step is not to be terminated, the following actions are taken:

• The task that was active when ABEND was issued is terminated, along with all of the subtasks of that active task.

• The completion code is posted as indicated in the completion code parameter description below.

• The end-of-task exit routine specified in the ATTACH macro instruction that created the task which issued ABEND is selected to be given control. The exit routine is given control when the originating task of the task for which ABEND was issued becomes active. None of the end-of-task exit routines specified for any subtasks of the task for which ABEND was issued are given control.

The ABEND macro instruction is written as follows:

name

One or more blanks must precede ABEND.

One or more blanks must follow ABEND.

comp code: symbol, decimal or hexadecimal digit, or register (1) or (2) - (12).

Valuerange: 0 - 4095

reason code: symbol, decimal or hexadecimal number, or register (2) - (12).

code type: USER or SYSTEM.

Default: code type = USER.

parm list addr: RX-type address, or register (2) - (12).

The parameters are explained as follows:

comp code

specifies the completion code associated with the abnormal termination. If the job step is to be terminated, the decimal representation of the user completion code or the

hexadecimal representation of the system completion code is recorded on the system

102 Supervisor Services and Macro Instructions

output device. If the job step is not to be terminated, the completion code is placed in the TCB of the active task, and in the ECB specified in the ECB parameter of the ATTACH macro instruction issued to create the active task. If you specify a hexadecimal digit, you must use X'dd' format to distinguish the hexadecimal from decimal.

,REASON = reason code

specifies the reason code that the user wants to pass to subsequent recovery exits. The value range for the reason code is a 32-bit hexadecimal number or a 31-bit decimal number. This reason code supplements the completion code associated with an abnormal termination, allowing the user to uniquely identify the cause of the abnormal termination.

The recovery termination manager propagates the reason code to each recovery exit and to the TCB and ASCB control blocks, making it available for system messages.

,DUMP

"STEP

",code type ,DUMP, STEP ,DUMP "code type

"STEP,code type ,DUMP ,STEP ,code type

specifies options available with the ABEND macro instruction:

DUMP specifies that a dump is requested of virtual storage areas assigned to the task and control blocks pertaining to the task. A separate dump is provided for each of the tasks being terminated as a result of ABEND. If a / /SYSABEND, / /SYSMDUMP, or / /SYSUDUMP DD statement is not provided, the DUMP parameter is ignored.

STEP specifies that the entire job step of the active task is to be abnormally terminated.

Note: If the STEP parameter is coded in an ABEND macro under TSO, the TSO job will be terminated.

code type specifies that the completion code is to be treated as a USER or SYSTEM code.

,DUMPOPT = parm list addr

specifies the address of a parameter list valid for the SNAP macro instruction. The parameter list is used to produce a tailored dump, and may be created by using the list form of the SNAP macro instruction, or a compatible list may be created. The TCB, DCB, ID, and STRHDR options available on SNAP will be ignored if they appear in the parameter list; the TCB used will be that of the task being terminated, the DCB used will be provided by the ABDUMP routine. If a //SYSABEND, //SYSMDUMP, or

/ /SYSUDUMP DD statement is not provided, the DUMPOPT parameter is ignored.

If the dump options specified include ranges of storage areas to be dumped, only the storage areas in the first thirty ranges will be dumped. If SUBPLST is specified in the SNAP parameter list passed to the ABEND macro instruction via DUMPOPT, the first seven subpools will be dumped.

ABEND - Abnormally Terminate a Task 103

Example 1

Example 2

Example 3

Operation: Terminate with a user completion code of 432.

ABEND 432

Operation: Terminate with the user completion code that is contained in register 5. The entire job step is to be terminated.

ABEND (5)"STEP

Operation: Terminate with a system completion code of X'OC4'.

ABEND X'OC4' "SYSTEM

104 Supervisor Services and Macro Instructions

Dans le document ana Macro Instructions (Page 114-117)