DO command (PL/I)
The DO command allows one or more commands to
be collected into a group that can (optionally) be repeatedly executed.
The DO and END keywords delimit
a group of commands collectively called a DO group.
The keywords cannot be abbreviated.
- command
- A valid z/OS® Debugger command.
WHILE- Specifies that expression is evaluated
before each execution of the command list. If the expression evaluates
to true, the commands are executed and the
DOgroup begins another cycle; if it evaluates to false, execution of theDOgroup ends. - expression
- A valid z/OS Debugger PL/I Boolean expression.
UNTIL- Specifies that expression is evaluated
after each execution of the command list. If the expression evaluates
to false, the commands are executed and the
DOgroup begins another cycle; if it evaluates to true, execution of theDOgroup ends. - command
- A valid z/OS Debugger command.
- reference
- A valid z/OS Debugger PL/I reference.
- expression
- A valid z/OS Debugger PL/I expression.
BY- Specifies that expression is evaluated
at entry to the
DOspecification and saved. This saved value specifies the increment to be added to the control variable after each execution of theDOgroup.If
BYexpression is omitted from aDOspecification and ifTOexpression is specified, expression defaults to the value of 1.If
BY0is specified, the execution of theDOgroup continues indefinitely unless it is halted by aWHILEorUNTILoption, or control is transferred to a point outside theDOgroup.The
BYoption allows you to vary the control variable in fixed positive or negative increments. TO- Specifies that expression is evaluated
at entry of the
DOspecification and saved. This saved value specifies the terminating value of the control variable.If
TOexpression is omitted from aDOspecification and ifBYexpression is specified, repetitive execution continues until it is terminated by theWHILEorUNTILoption, or until some statement transfers control to a point outside theDOgroup.The
TOoption allows you to vary the control variable in fixed positive or negative increments. REPEAT- Specifies that expression is evaluated
and assigned to the control variable after each execution of the
DOgroup. Repetitive execution continues until it is terminated by theWHILEorUNTILoption, or until some statement transfers control to a point outside theDOgroup.The
REPEAToption allows you to vary the control variable nonlinearly. This option can also be used for nonarithmetic control variables, such as pointers. WHILE- Specifies that expression is evaluated
before each execution of the command list. If the expression evaluates
to true, the commands are executed and the
DOgroup begins another cycle; if it evaluates to false, execution of theDOgroup ends. UNTIL- Specifies that expression is evaluated
after each execution of the command list. If the expression evaluates
to false, the commands are executed and the
DOgroup begins another cycle; if it evaluates to true, execution of theDOgroup ends. - command
- A valid z/OS Debugger command.
Usage note
You
cannot use the DO command while you replay recorded
statements by using the PLAYBACK commands by using
the PLAYBACK command.
Examples
- At statement 25, initialize variable
aand display the values of variablesx,y, andz.AT 25 DO; %BLOCK:>a = 0; LIST (x, y, z); END; - Execute the
DOgroup untilctris greater than 4 or less than 0.DO UNTIL (ctr > 4) WHILE (ctr >= 0); END; - Execute the
DOgroup withihaving the values 1, 2, 4, 8, 16, 32, 64, 128, and 256.DO i = 1 REPEAT 2*i UNTIL (i = 256); END; - Repeat execution of the
DOgroup withjhaving values 1 through 20, but only ifkhas the value 1.DO j = 1 TO 20 BY 1 WHILE (k = 1); END;
