| The OPTMODEL Procedure |
The STOP statement halts the execution of all statements that contain it, including DO statements and other control or looping statements. Execution continues with the next top-level source statement. The following code demonstrates a simple use of the STOP statement:
proc optmodel;
number i, j;
do i = 1..5;
do j = 1..4;
if i = 3 and j = 2 then stop;
end;
end;
print i j;
The output is shown in Output 6.28.
When the counters i and j reach 3 and 2, respectively, the STOP statement terminates both loops. Execution continues with the PRINT statement.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.