Cancel procedure run
| Component: | SYSFILE | 
| Functional area: | Procedures | 
| Domain: | PROCEDURE | 
| Privileges: | STD-PROCESSING  | 
Function
The CANCEL-PROCEDURE command cancels a procedure run. SYSCMD is assigned to the primary command input. (See the EXIT-PROCEDURE command: SYSCMD is assigned to the procedure most recently left). All system files opened during procedure execution, including TASKLIB, are closed and again receive their primary assignments.
Format
| CANCEL-PROCEDURE  | 
The CANCEL-PROCEDURE command has no operands and is executed immediately.
Return codes
| (SC2) | SC1 | Maincode | Meaning | 
|---|---|---|---|
| 0 | CMD0001 | Command executed | |
| 32 | SSM1013 | Command not executed due to system error | |
| 64 | SSM2039 | Error on closing output system file; the SYSOUT message contains the DMS error codes as an insert | 
Notes
- Commands in procedure files: if an error in a non-S procedure triggers the spin-off mechanism, processing branches to the next of the following commands: CANCEL-PROCEDURE, LOGOFF, EXIT-JOB, SET-JOB-STEP, END-PROCEDURE or EXIT-PROCEDURE. 
- A CANCEL-PROCEDURE command at procedure level 1 (i.e. no nesting) is identical to the EXIT-PROCEDURE command (see "Figure: CANCEL- and EXIT-PROCEDURE commands at procedure level 1)". 
Examples
Example 1
The arrows indicate the sequence in which the commands are processed.
Example 2
The solid lines indicate the sequence in which the commands are processed in the case of CANCEL-PROCEDURE. By way of comparison, the broken lines indicate the process in the case of EXIT-PROCEDURE.

