DO Statement with an UNTIL Clause
conditionally executes statements iteratively
- DO UNTIL( expression);
- DO variable=start TO stop
The inputs to the DO UNTIL statement are as follows:
Using an UNTIL expression makes possible the conditional
execution of a set of statements iteratively.
The UNTIL expression is evaluated at the bottom of the loop,
and the statements inside the loop are executed repeatedly
as long as the expression yields a zero or missing value.
In the example that follows, the body of the
loop executes until the value of X exceeds 100:
- is an expression that is evaluated at the
bottom of the loop for being true or false.
- is the name of a variable indexing the loop.
- is the starting value for the looping variable.
- is the stopping value for the looping variable.
- is an increment value.
do until (x>100);
print x; /* x=101 */
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.