Here's the code I had before with Reinhard's correction, learn something everyday: data have; infile cards dsd; input RAWREG$ PVPRISM$ OVRIDE3 DAYS; cards; 01,0939,,408 ,0943,,379 09,0029,,170 11,0948,, ,0948,,59 04,6108,,57 06,0993,,59 06,6111,,59 06,0993,,220 04,0901,,59 aa,aaaa,,5 .,.,,5 ; proc sql; create table get_max as select *,count(*) as max_obs from have; options missing=' '; proc transpose data=get_max out=tran;by max_obs;var _all_; data want (keep=Variable missing non_missing); set tran(rename=(_name_ = Variable)); Missing=cmiss(of col: ); Non_Missing=max_obs - missing; if variable in ('max_obs') then delete; run; proc sort data=want;by Variable;
... View more