I like Mike's and NULL's code if you have lots of variables needed to process. Here is my code almost the same with Mike , Null . data test;
input Agency &$10. (Q1 Qa1 Q2)(:percent.);
cards;
Agency 1 98% 98% 96%
Agency 2 100% 99% 100%
Agency 3 94% 91% 93%
Agency 4 95% 95% 95%
Agency 5 96% 94% 96%
Agency 6 99% 98% 100%
;;;;
run;
proc summary data=test;
var q: ;
output out=mean (drop=_:) mean= ;
run;
proc summary data=test;
var q: ;
output out=median(drop=_:) median= ;
run;
proc summary data=test;
var q: ;
output out=min(drop=_:) min= ;
run;
proc summary data=test;
var q: ;
output out=max(drop=_:) max= ;
run;
data want;
set test mean median min max indsname=dsn;
if missing(agency) then agency=scan(dsn,-1,'.');
run;
ods listing close;
ods html file='c:\agencies.html' style=sasweb;
proc print data=want noobs;
run;
ods html close;
ods listing
Ksharp
... View more