Use the WHILE statement to test a condition and execute
statements within the body of the WHILE loop as long as the condition
is true.
Refer to IF for condition syntax.
Example
WHILE I > 0 DO
I = I - I;
SEND_KEY ( ENTER );
ENDWHILE
Procedure
To use the
3270 Script window’s Statements menu to define a WHILE statement,
follow this procedure:
- From the Welcome window, click on Applications
—> 3270 Servers
- Selecting the WHILE statement : Click Statements
—> Conditional.
The system displays the Conditional
Definition window.
- Click the button next to WHILE condition DO.
- Defining the condition : To define the condition, follow
Steps 4 through 10 in the procedure for IF.
- Adding the statement to the script : Click OK.
The WHILE statement is added to the script.
- Defining DO statements : Use the Statements menu
to define the statement that you want to execute when the WHILE condition
is true. Refer to the statement description for instructions.
The
statement is added to the script following the DO keyword.
- Repeat Step 6 for each action
to be performed when the WHILE condition is true.