The CMDRC macro enables user programs to save certain values as “command return codes” for the program. When the program is ended, the command processor returns these values instead of the official return codes. The values may be interpreted as the command return codes of the program or those of the command with which the program was started (START-PROGRAM or RESUME-PROGRAM). This command return code can then be used further by other system functions (e.g. SDF-P).
The return code defined with CMDRC is not available until the program is ended, because until then it is buffered by the command processor. Only the return code most recently set by CMDRC is of significance. The official command return code in the command processor is not modified by CMDRC during program execution.
Operation | Operands |
CMDRC | RCADDR = addr [ ,MF = |
RCADDR=addr
Address of the command return code.
The DSECT for the command return code is created with the CMDRETC macro (see "CMDRETC Generate DSECT for command return codes").
MF=
defines special requirements for macro expansion (see the “Executive Macros” manual [8 (Related publications)] for details).
L
Only the data part of the macro expansion (operand list) is generated. This requires that no operand types with executable code appear in the macro. The data part generated has the address specified in the name field of the macro.
(E,(1)) / (E,opaddr)
Only the instruction part of the macro expansion is generated. The associated data part (operand list) is referenced by the address “opaddr”. This is either in register 1 or is specified directly.
Register usage
Register 1: address of the parameter list
Return information and error flags
Register 15 contains a return code in the right-most byte.
X’00’ X’01’ | normal execution abnormal execution |