Here is a solution, the _all_ adds some noise but it'll work.: data have; infile cards dsd; input Obs RAWREG$ PVPRISM$ OVRIDE3 DAYS; cards; 1,01,0939,,408 2,,0943,,379 3,09,0029,,170 4,11,0948,, 5,,0948,,59 6,04,6108,,57 7,06,0993,,59 8,06,6111,,59 9,06,0993,,220 10,04,0901,,59 ; proc sql; create table get_max as select *,max(obs) as max_obs from have; 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=nmiss(of col: ); Non_Missing=max_obs - missing; if variable in ('Obs','max_obs') then delete; run;
... View more