IF command (PL/I)
The IF
command lets you conditionally perform
a command. You can optionally specify an ELSE
clause
on the IF
command. If the test expression evaluates
to false and an ELSE
clause exists, the command associated
with the ELSE
clause is performed. The keywords
cannot be abbreviated.
- expression
- A valid z/OS® Debugger PL/I
expression.
If necessary, the expression is converted to a
BIT
string. - command
- A valid z/OS Debugger command.
When IF
commands are nested and ELSE
clauses
are present, a given ELSE
is associated with the
closest preceding IF
clause within the same block.
Usage notes
- An
ELSE
clause should always be included if theIF
clause causes z/OS Debugger to get more input (for example, anIF
containingUSE
or other commands that cause z/OS Debugger to be restarted because anAT
-condition occurs). - The
if
command cannot be used while you replay recorded statements by using theLAYBACK
commands.
Examples
- If the value of
array1
is equal to the value ofarray2
, go to the statement with label constantlabel_1
. Execution of the user program continues atlabel_1
. Ifarray1
does not equalarray2
, theGOTO
is not performed and control is passed to the user program.IF array1 = array2 THEN GOTO LABEL label_1; ELSE GO;
- Set a breakpoint at statement 23, which will test if variable
j
is equal to 10, display the names and values of variablesrmdr
,totodd
, andterms(j)
. If variablej
is not equal to 10, continue program execution.AT 23 IF j = 10 THEN LIST TITLED (rmdr, totodd, terms(j)); ELSE GO;