z/OS TSO/E REXX User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


RC

z/OS TSO/E REXX User's Guide
SA32-0982-00

RC stands for return code and is set every time a command is issued. When a command ends without error, RC is usually set to 0. When a command ends in error, RC is set to whatever return code is assigned to that error.

For example, the previous incorrect LISTDS command is issued followed by the RC special variable in a SAY instruction.
"LISTDS ?"
SAY 'The return code from the command is' RC
This results in the following:
   MISSING DATA SET NAME
   INVALID KEYWORD, ?
   The return code from the command is 12
   ***
The RC variable can be especially useful in an IF instruction to determine which path an exec should take.
'ALLOC DA('dsname') F(SYSPROC) SHR REUSE'
IF RC \= 0 THEN
  CALL error1
ELSE NOP
Note: The value of RC is set by every command and might not remain the same for the duration of an exec. When using RC, make sure it contains the return code of the command you want to test.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014