Executes the statements between DO WHILE and ENDDO while a specified condition is true.

Syntax

DO WHILE <condition expL>
 [ <statements> ]
ENDDO

<condition expL>

A logical expression that is evaluated before each iteration of the loop to determine whether the iteration should occur. If it evaluates to true, the statements are executed. Once it evaluates to false, the loop is terminated and execution continues with the statement following the ENDDO.

<statements>

Zero or more statements executed in each iteration of the loop.

ENDDO

A required keyword that marks the end of the DO WHILE loop.

Description

Use a DO WHILE loop to repeat a statement or block of statements while a condition is true. If the condition is initially false, the statements are never executed.

You may also exit the loop with EXIT, or restart the loop with LOOP.