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'
IFRC \= 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.
SIGL
The SIGL special variable is used in connection with a transfer of control within an
exec because of a function, or a SIGNAL or CALL instruction. When the language
processor transfers control to another routine or another part of the exec, it sets the
SIGL special variable to the line number from which the transfer occurred.
000001 /* REXX */
..
.
000005 CALL routine
..
.
000008
000009 routine:
000010 SAY 'We came here from line' SIGL
/* SIGL is set to 3 */
000011 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 what command
caused an error and what the error was. When SIGNAL ON ERROR is included in
an exec, 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 normally take place, such as the display of error messages.
000001 /* REXX */
000002 SIGNAL ON ERROR
000003 "ALLOC DA(new.data) LIKE(old.data)"
..
.
000008 "LISTDS ?"
..
.
000011 EXIT
000012
000013 ERROR:
000014 SAY 'The return code from the command on line' SIGL 'is' RC
000015 /* Displays:
000016
The return code from the command on line 5 is 12
*/
For more information about the SIGNAL instruction, see
Tracing with the Interactive Debug Facility
The interactive debug facility permits a user to interactively control the execution of
an exec. A user can view the tracing of various types of instructions separated by
pauses as the exec runs. During a pause, a user can continue to the next traced
instruction, insert instructions, re-execute the previous instruction, and change or
terminate interactive tracing.
Debugging Execs
Chapter 9. Diagnosing Problems Within an Exec
113
Summary of Contents for TSO/E REXX
Page 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 2: ......
Page 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Page 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Page 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Page 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Page 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Page 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Page 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Page 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Page 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Page 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Page 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Page 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Page 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Page 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Page 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Page 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Page 241: ......