Signal Instruction - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Using Interrupt Instructions
When calling an external subroutine, CALL passes control to the exec name that is
specified after the CALL keyword. When the external subroutine completes, you can
use the RETURN instruction to return to where you left off in the calling exec.
For more information about calling subroutines, see "Chapter 6. Writing Subroutines
and Functions" on page 69.

SIGNAL Instruction

The SIGNAL instruction, like CALL, interrupts the normal flow of an exec and
causes control to pass to a specified label. The label to which control passes can
appear before or after the SIGNAL instruction. Unlike CALL, SIGNAL does not
return to a specific instruction to resume execution. When you use SIGNAL from
within a loop, the loop automatically ends; and when you use SIGNAL from an
internal routine, the internal routine will not return to its caller.
In the following example, if the expression is true, then the language processor
goes to the label Emergency: and skips all instructions in between.
58
z/OS V1R1.0 TSO/E REXX User's Guide
instruction(s)
CALL sub1
instruction(s)
EXIT
sub1:
instruction(s)
RETURN
REXX.EXEC(MAIN)
instruction(s)
CALL sub2
instruction(s)
.
.
.
REXX.EXEC(SUB2)
instruction(s)
RETURN

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents