Wednesday, May 4, 2011

Find the maximum

/******** SAS Data Step ********/
data prior;
input prior @@;
cards;
1 5.2 8 7.2 4.6 2.1 .7 .1 0 0 10 3 20 19
;
run;
data max (keep=max);
set prior end=last;
retain max;
if max<prior then max=prior;
if last then output;
run;
proc print;
run;
/******** Proc Means ********/
proc means data=prior;
output out=s max=maximum;
run;
proc print data=s (keep=maximum);
run;

No comments:

Post a Comment