IBM SC34-5764-01 Server User Manual


 
code following the SYNTAX label may PARSE SOURCE to find the source of the data, then call an editor
to edit the source file positioned at the line in error. Note that in this case you may have to run the
program again before any changes made in the editor can take effect.
Alternatively, SIGL can be used to help determine the cause of an error (such as the occasional failure of
a function call) as in the following example:
signal on syntax
a=a+1 /*This is to create a syntax error */
say 'SYNTAX error not raised'
exit
/* Standard handler for SIGNAL ON SYNTAX */
syntax:
say 'REXX error' rc 'in line' sigl':' "ERRORTEXT"(rc)
say "SOURCELINE"(sigl)
trace ?r; nop
This code first displays the error code, line number, and error message. It then displays the line in error,
and finally drops into debug mode to let you inspect the values of the variables used at the line in error.
Conditions and Condition Traps
Chapter 17. Conditions and Condition Traps 229