SELECT command (PL/I)

The SELECT command chooses one of a set of alternate commands.

If the reference can be satisfied by more than one of the WHEN clauses, only the first one is performed. If there is no reference, the first WHEN clause containing an expression that is true is executed. If none of the WHEN clauses are satisfied, the command specified on the OTHERWISE clause, if present, is performed. If the OTHERWISE clause should be executed and it is not present, a z/OS® Debugger message is issued.

Read syntax diagramSkip visual syntax diagramSELECT(reference);WHEN(,expression)commandOTHERWISEcommandEND;
reference
A valid z/OS Debugger PL/I scalar reference. An aggregate (array or structure) cannot be used as a reference.
WHEN
Specifies that an expression or a group of expressions be evaluated and either compared with the reference immediately following the SELECT keyword, or evaluated to true or false (if reference is omitted).
expression
A valid z/OS Debugger PL/I expression.
command
A valid z/OS Debugger command.
OTHERWISE
Specifies the command to be executed when every test of the preceding WHEN statements fails.

Usage notes

  • You cannot use the SELECT command while you replay recorded statements by using the PLAYBACK commands.

Example

When sum is equal to the value of c+ev, display a message. When sum is equal to either fv or 0, display a message. If sum is not equal to the value of either c+ev, fv, or 0, a z/OS Debugger error message is issued.
SELECT (sum);
  WHEN (c + ev) LIST ('Match on when group number 1');
  WHEN (fv, 0) LIST ('Match on when group number 2');
END;