I have a data set with a number of records (the contents of which are irrelevant) and a series of flag variables at the end of each record. Something like this:
Record ID Flag 1 Flag 2 Flag 3
1 Y
2 Y Y
3
4
5
6 Y Y
I would like to create a printed report (or, ideally, a data set that I could then print) that would look something like the following:
Variable N % Not Missing
Flag 1 6 33.33333
Flag 2 6 33.33333
Flag 3 6 16.66666
I can accomplish something close to what I want for one variable at a time using Proc Freq with something like this:
proc freq data=Work.Records noprint;
tables Flag1 /out=Work.Temp;
run;
I suppose I could easily write a macro to loop through each variable and concatenate the results into one data set... but that seems WAY too complex for this. There has to be a built-in SAS procedure for this, but I'm not finding it.
Any thoughts out there?
Thanks!