v
Interrupt instructions, which tell the language processor to leave the exec entirely
or leave one part of the exec and go to another part, either permanently or
temporarily. The REXX interrupt instructions are:
EXIT
SIGNAL
label
CALL
label
/RETURN
Using Conditional Instructions
There are two types of conditional instructions. IF/THEN/ELSE can direct the
execution of an exec to one of two choices. SELECT/WHEN/OTHERWISE/END can
direct the execution to one of many choices.
IF/THEN/ELSE Instructions
The examples of IF/THEN/ELSE instructions in previous chapters demonstrated the
two-choice selection. In a flow chart, this appears as follows:
As a REXX instruction, the flowchart example looks like:
IFexpression THEN instruction
ELSE instruction
You can also arrange the clauses in one of the following ways to enhance
readability:
IFexpression THEN
instruction
ELSE
instruction
or
IFexpression
THEN
instruction
ELSE
instruction
When you put the entire instruction on one line, you must separate the THEN
clause from the ELSE clause with a semicolon.
IFexpression THEN instruction; ELSE instruction
Generally, at least one instruction should follow the THEN and ELSE clauses. When
either clause has no instructions, it is good programming practice to include NOP
(no operation) next to the clause.
IF
expression
False
True
ELSE
THEN
instruction
instruction
Controlling the Flow Within an Exec
42
z/OS V1R1.0 TSO/E REXX User’s Guide
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: ......