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


SIGL

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

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 z/OS TSO/E REXX Reference.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014