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.

Read syntax diagramSkip visual syntax diagram IF expression THEN command ELSEcommand ;
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 the IF clause causes z/OS Debugger to get more input (for example, an IF containing USE or other commands that cause z/OS Debugger to be restarted because an AT-condition occurs).
  • The if command cannot be used while you replay recorded statements by using the LAYBACK commands.

Examples

  • If the value of array1 is equal to the value of array2, go to the statement with label constant label_1. Execution of the user program continues at label_1. If array1 does not equal array2, the GOTO 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 variables rmdr, totodd, and terms(j). If variable j is not equal to 10, continue program execution.
    AT 23 IF j = 10 THEN LIST TITLED (rmdr, totodd, terms(j)); ELSE GO;