IBM SC34-5764-01 Server User Manual


 
SIGL
The language processor sets the SIGL special variable in connection with a transfer of control within a
program because of a function, a SIGNAL or a CALL instruction. When the language processor transfers
control to another routine or another part of the program, it sets the SIGL special variable to the line
number from which the transfer occurred. (The line numbers in the following example are to aid in
discussion after the example. They are not part of the program.)
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” on page 164.
Tracing with the Interactive Debug Facility
The interactive debug facility lets a user control the execution of a program. The language processor reads
from the terminal, and writes output to the terminal.
Starting Interactive Debug
To start interactive debug, specify ? before the option of a TRACE instruction, for example: TRACE ?A.
There can be no blank(s) between the question mark and the option. Interactive debug is not carried over
into external routines that are called but is resumed when the routines return to the traced program.
Options within Interactive Debug
After interactive debug starts, you can provide one of the following during each pause or each time the
language processor reads from the input stream.
v A null line, which continues tracing. The language processor continues execution until the next pause or
read from the input stream. Repeated input of a null line, therefore, steps from pause point to pause
point until the program ends.
v An equal sign (=), which re-executes the last instruction traced. The language processor re-executes
the previously traced instruction with values possibly modified by instructions read from the input
stream. (The input can also be an assignment, which changes the value of a variable.)
v Additional instructions. This input can be any REXX instruction, including a command or call to another
program. This input is processed before the next instruction in the program is traced. For example, the
input could be a TRACE instruction that alters the type of tracing:
TRACE L /* Makes the language processor pause at labels only */
The input could be an assignment instruction. This could change the flow of a program, by changing the
value of a variable to force the execution of a particular branch in an IF THEN ELSE instruction. In the
following example, RC is set by a previous command.
IF RC = 0 THEN
DO
instruction1
Diagnosing Problems within a Program
86
CICS TS for VSE/ESA: REXX Guide