Do loops are great for a long list of tasks. Understanding do loops can save you an innumerable amount of programming and work arounds.
The basic form of a do loop is as follows:
Do some_index_var= 1 to 50 by 1;
Some SAS statements go here;
However, specifically in this post we want to talk about DO UNTIL loops. Do until loops are different because they evaluate the condition at the bottom of the loop. Example:
Do until var > 100;
Some SAS statements;
This loop will execute the SAS statements at least one time and evaluate the var>100 condition at the bottom of the loop. If the condition is false, the loop will execute again.