Date: Mon, 6 May 2002 15:39:16 -0400
Reply-To: Santosh Verma <santoshkverma@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Santosh Verma <santoshkverma@HOTMAIL.COM>
Subject: How to find missing freq
I have made a program to find missing freq for all var in a large dataset
that contains both character and numeric variables. Character variables are
like address, accident description... So you can not use 'PROC FREQ'
easily. I want to present this to Boston SAS user group but I don't know if
there is a better way of doing this. If any one of you can do it in a
better way please let me know.
%macro misfreq(data);
proc format;
value $missfmt ' '='Missing'
other='Other';
value missing . = 'Missisng'
other ='Other';
run;
ods output OneWayFreqs = work.oneway;
proc freq data = &data;
tables _all_ / missing;
format _character_ $missfmt.;
format _numeric_ missing.;
run;
proc sort data = oneway; by table;
data misfreq_&data(keep = table misfreq);
set oneway;
by table;
if first.table =1 and last.table=0;
rename frequency= misfreq;
run;
proc print data = misfreq_&data;
run;
%mend;
The only problem with this macro is that you can not give 'noprint' option
in 'Proc Freq' statement.