1# zgwshmily
simple way in data step. You can refine as you need.
**********************
data survey;
input id diet exer hours xwk educ;
datalines;
1 1 . 1 3 1
1 . 2 1 4 2
1 . 4 . . .
1 1 5 2 3 .
2 . 9 2 3 .
2 5 9 2 4 .
2 . 3 . 5 3
3 2 . . . .
;
run;
data miscount(keep=MisNo:);
set survey nobs=totobs;
array col{6} id diet exer hours xwk educ;
array MisNo{6} (0,0,0,0,0,0);
do i=1 to 6;
if missing(col{i}) then MisNo{i} = MisNo{i}+1;
end;
if _N_=totobs then output;
run;
proc print data=miscount;
run;