Syntax, DO group:
DO;
SAS
statements
END;
Tip:You can nest DO statements
within DO groups.
|
data work.stresstest;
set cert.tests;
TotalTime=(timemin*60)+timesec;
retain SumSec 5400;
sumsec+totaltime;
length TestLength $6 Message $20;
if totaltime>800 then
do;
TestLength='Long';
message='Run blood panel';
end;
else if 750<=totaltime<=800 then TestLength='Normal';
else if totaltime<750 then TestLength='Short';
run;
proc print data=work.stresstest;
run;
Syntax, DO statement,
iterative:
DO index-variable=specification-1 <,
...specification-n>;
...more SAS statements...
END;
|
data work.earn (drop=month); set cert.master; Earned=0; earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); earned+(amount+earned)*(rate/12); run;
data work.earnings (drop=month); set cert.master; Earned=0; do month=1 to 12; earned+(amount+earned)*(rate/12); end; Balance=Amount+Earned; run; proc print data=work.earnings; run;