Using REXX special variables RC and SIGL
The REXX language has three special variables: RC, SIGL, and RESULT. REXX/CICS sets these variables during particular situations and you can use them in an expression at any time. If REXX/CICS did not set a value, a special variable has the value of its own name in uppercase, as do other variables in REXX. You can use two special variables, RC and SIGL, to help diagnose problems within programs.
RC
RC stands for return code. The language processor sets RC every time a program issues a command. When a command ends without error, RC is usually 0. When a command ends in error, RC is whatever return code is assigned to that error.
The RC variable can be especially useful in an IF instruction to determine which path a program should take.
SIGL
1 /* REXX */
2 :
3 CALL routine
4 :
5
6 routine:
7 SAY 'We came here from line' SIGL /* SIGL is set to 3 */
8 RETURN
If the called routine itself calls another routine, SIGL is reset to the line number from which the most recent transfer occurred.
SIGL and the SIGNAL ON ERROR instruction can help determine which command caused an error and what the error was. When SIGNAL ON ERROR is in a program , any host command that returns a nonzero return code causes a transfer of control to a routine named error . The error routine runs regardless of other actions that would usually take place, such as the transmission of error messages.
For more information about the SIGNAL instruction, see section SIGNAL.