DETACH (Detach Task) Macro
The macro terminates execution of a task.
A subtask is normally terminated by issuing a DETACH macro in the main task, attaching subtask, or in the subtask itself.
The macro sets byte 2, bit 0 of the ECB to 1 (if specified in the ATTACH macro) to indicate task termination. All tasks waiting on this ECB are taken out of the wait state.
If the subtask issues a DETACH macro without an operand, only the subtask issuing the DETACH macro is terminated. Any subtasks attached by the terminating subtask are not affected by the termination.
If the main task issues the DETACH macro without specifying an operand, it is canceled, that is, all processing in the partition is terminated abnormally. However, the partition might recover, dependent on the AB exit specification.
Format
Requirements for the caller
- AMODE:
- 24 or 31
- RMODE:
- 24 or ANY
- ASC Mode:
- Primary
Parameters
- SAVE=savearea | (1)
- A subtask can also terminate a subtask by issuing the DETACH macro with the SAVE operand. If the main task issues the DETACH macro with the SAVE operand, it can terminate any subtask in the partition. The SAVE operand provides the address of the save area specified in the ATTACH macro for the subtask to be terminated. The save area must be allocated below the 16 MB line.