The Sum Statement
The Iterative DO Loop
Other Forms of an Iterative DO Loop
DO WHILE and DO UNTIL Statements
A Caution When Using DO UNTIL Statements
LEAVE and CONTINUE Statements
Many programming tasks require that blocks of code be run more than once. SAS provides several ways to accomplish this. This chapter covers DO groups, DO loops, DO WHILE statements, and DO UNTIL statements.
To demonstrate a DO group, we start with a data file containing some information on students: their age, gender, midterm grade, quiz grade, and final exam grade. A listing of this data file follows: