Syntax, DO group:
DO;
SAS
statements
END;
Tip:You can nest DO statements
within DO groups.
|
data clinic.stress; infile tests; input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 RecHR 35-37 TimeMin 39-40 TimeSec 42-43 Tolerance $ 45; 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;
data payroll; set salaries; select(payclass); when ('monthly') amt=salary; when ('hourly') do; amt=hrlywage*min(hrs,40); if hrs>40 then put 'CHECK TIMECARD'; end; otherwise put 'PROBLEM OBSERVATION'; end; run;
do; statements; do; statements; do; statements; end; end; end;