data finance.earnings; Amount=1000; Rate=.075/12; do month=1 to 12; Earned+(amount+earned)*rate; end; run;
data work.earn (drop=counter); Value=2000; do counter=1 to 20; Interest=value*.075; value+interest; Year+1; end; run;
data work.earn;
Value=2000;
do Year=1 to 20;
Interest=value*.075;
value+interest;
output;
end;
run;
DO index-variable=5 to 1 by -1; ...more SAS statements... END;
DO index-variable=5 to 1 by -1; ...more SAS statements... END;
Syntax, DO loop with
a variable list:
DO index-variable=value1,
value2, value3... ;
...more
SAS statements...
END;
|
DO index-variable=2,5,9,13,27; ...more SAS statements... END;
DO index-variable='MON','TUE','WED','THR','FRI'; ...more SAS statements... END;
DO index-variable=win,place,show; ...more SAS statements... END;