Special Variable RC
The REXX special variable RC normally contains the return code from host command most
recently executed. The special value -3 indicates that the specified command was not found.
If a system abend occurs, the value returned is the negative of the decimal value
of the abend code. For example, an S0C1 abend would result in RC = -193. For a user abend,
RC is set to the decimal value of the abend code.
If no abend occurs, then RC is set to the decimal value of the return code returned by the command. For REXX services provided by IBM or other software vendors, refer to the
product documentation for more information on how to interpret these return codes.
Unix System Services
For the SYSCALL environment (callable services):
Additional information may be found in the following special variables:
- -3 usually means that syscalls('ON') has not been issued or did not succeed
- -20 indicates that the command was not recognized
- -2n indicates that the nth parameter was invalid
ERRTEXT on the Unix System Services and REXX page can be used to look up additional
information on the ERRNO and ERRNOJR codes.
- RETVAL contains valid information when RC >= 0
- ERRNO contains a hexadecimal error number when RETVAL = -1
- ERRNOJR contains a hexadecimal reason code when RETVAL = -1
For More Information
Visit the REXX page here for more sources of REXX info.