Resume suspended procedure run
Component: | SYSFILE |
Functional area: | Procedures |
Domain: | PROCEDURE |
Privileges: | STD-PROCESSING |
Function
The RESUME-PROCEDURE command ends ESCAPE mode (see the HOLD-PROCEDURE command) and resumes execution of an interrupted procedure.
Format
RESUME-PROCEDURE | Alias: RUP |
MODE = *ACTUAL / *CMD / *PROGRAM |
Operands
MODE =
Mode in which procedure execution is to be continued.
MODE = *ACTUAL
Procedure execution is continued in the mode in effect at the time it was interrupted. Command mode: Control returns to the next command in the procedure file.
Program mode: The interrupted program is resumed at the address at which it was interrupted.
MODE = *CMD
The procedure is to be continued in command mode. If the procedure was interrupted in program mode, the interrupted program remains loaded until a RESUME-PROCEDURE command with MODE=*PROGRAM is given.
MODE = *PROGRAM
The procedure is to be continued in program mode. If no program is loaded, an error message is issued and control is returned to the terminal. The user can then enter the RESUME-PROCEDURE command with MODE=*CMD to continue the procedure run in command mode.
Return codes
(SC2) | SC1 | Maincode | Meaning |
---|---|---|---|
0 | CMD0001 | Command executed without error | |
64 | SSM2018 | Command not permitted in batch mode in a noninterruptible procedure | |
64 | SSM2019 | No interrupted procedure exists | |
64 | SSM2020 | MODE=*PROGRAM and no program loaded | |
64 | SSM2013 | No program loaded |
Notes
An interrupted procedure can be continued only by means of the RESUME-PROCEDURE command.
The RESUME-PROCEDURE command must always be entered in dialog. If it is part of a procedure or part of a batch job, an appropriate error message is issued and the spinoff mechanism is activated.
If a procedure interrupted in command mode is to be continued in program mode, this can only be done by explicitly specifying the operand MODE=*PROGRAM. The program itself can have been loaded at any desired level and may be continued at any desired level. The program is, however, tied to the system file assignments (ASSIGN command) applicable to whichever is the current level.
The EXIT-PROCEDURE command causes a direct switch from the ESCAPE mode of the current procedure to the ESCAPE mode of the next lower procedure level. This procedure can then be continued in the current mode by means of the RESUME-PROCEDURE command (without operands). It is also possible to continue the procedure in a different mode by specifying the operand MODE=*PROGRAM/*CMD.
Example
The arrows indicate the sequence in which commands are processed (SYSCMD).
With the command
/CALL-PROC FROM=PROC1
, the procedure PROC1 is started and SYSCMD is assigned to the procedure file PROC1.In the procedure the program PROG is loaded and started. The logical system files of procedure level 1 are assigned to the program. The procedure PROC1 is interrupted by pressing [K2] in program mode, i.e. the interruption occurs during execution of the program PROG. SYSCMD is assigned to the terminal (ESCAPE mode).
With the command
/CALL-PROC FROM=PROC2
, the procedure PROC2 is started and SYSCMD is assigned to the procedure file PROC2.The procedure PROC2 is interrupted in command mode by a HOLD-PROCEDURE command. SYSCMD is assigned to the terminal (ESCAPE mode).
The program PROG interrupted by [K2] is continued at procedure level 2. The logical system files of procedure level 2 are now assigned to the program. If the program run terminates at this procedure level (last instruction executed), control is passed to the procedure PROC2. Processing is continued with the command following the HOLD-PROCEDURE command.
Procedure PROC2 is terminated by
/END-PROC
, and SYSCMD is again assigned to the terminal (level-1 ESCAPE mode; level 1 is still in program mode).The RESUME-PROCEDURE command cancels the level-1 ESCAPE mode. Since at this time the program PROG is no longer loaded, the user must specify the operand “MODE=*CMD” in order to switch from program mode to command mode.
SYSCMD is again assigned to the primary command input.