07-17-2012 01:45 PM
I tried to execute below program using PROC FREQ. While executing this program, added OUT Parameter in FREQ Procedure. My expectation is in the OUT SAS Data set (full) will create all the fields data. But unfortunately, am getting only ID Data only. Please suggest me or help me , how can I get all fields data into SAS Data set Full ( which is creating as part of OUT Parameter in PROC FREQ).
options obs=max compress=yes;
libname a "/root/samba/d071212";
PROC FREQ DATA = a.test1;
ID /list missing
07-17-2012 06:11 PM
From the online help:
If more than one table request appears in the TABLES statement, the contents of the OUT= data set correspond to the last table request in the TABLES statement.
So do you need counts only or percents as well?
Use Proc freq with multiple tables statements creating multiple output data sets and then combine the output sets.
Use another procedure.
07-17-2012 06:14 PM
hi ... OUT= will only contain one table, that for the last variable listed in the TABLES statement
you can try ODS to get all the results in one data set, for example ...
ods listing close;
ods output onewayfreqs=tables (drop=f_;
proc freq data=sashelp.class;
tables _all_ / missing;
ods output close;
the resulting data set is a little "messy" and you'll have to write a bit of SAS code to make it usable (the DROP data set option drops the formatted values of variables from the data set so if you also want them, get rid of the DROP)
I wrote a paper about using the above SAS code to create a missing data report and it has some ideas you might be able to use in looking at the data set you get from PROC FREQ ...