Language Reference
CONTINUE Statement
CONTINUE ;
This statement is supported by the IML procedure and the iml action.
The CONTINUE statement stops the processing of the current iteration of a DO loop and resumes processing at the next iteration of the DO loop. The CONTINUE statement can be used only inside a DO loop.
You can use the CONTINUE statement to skip a computation within a DO loop when a specified condition occurs. For example, the following program skips computations that involve a missing value:
x = 1:10;
x[{3 7 8}] = .;
sum = 0;
do i = 1 to ncol(x);
if x[i] = . then continue; /* go to the next iteration */
sum = sum + x[i];
end;
print sum;
Figure 79: Sum of Nonmissing Values
| sum |
|---|
| 37 |
The CONTINUE statement can be used to skip an iteration without exiting a DO loop. To exit a DO loop, you can use the DO-WHILE statement, the DO-UNTIL statement, or the LEAVE statement.