data work.invest;
do year=1 to ? ;
Capital+2000;
capital+capital*.10;
end;
run;
Syntax, DO UNTIL statement:
DO UNTIL(expression);
...more
SAS statements...
END;
|
data work.invest;
do until(Capital>=50000);
capital+2000;
capital+capital*.10;
Year+1;
end;
run;
Syntax, DO WHILE statement:
DO WHILE(expression);
...more
SAS statements...
END;
|
data work.invest;
do while(Capital>=50000);
capital+2000;
capital+capital*.10;
Year+1;
end;
run;
data work.invest;
do year=1 to 10 until (Capital>=50000);
capital+2000;
capital+capital*.10;
end;
run;
data work.invest; do year=1 to 10 until (Capital>=50000); capital+4000; capital+capital*.10; end; run;
DO index-variable=start TO stop BY increment UNTIL(expression);
DO index-variable=start TO stop BY increment WHILE(expression);