Dear All,
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;
tables Accountnumber
SOURCE
DATE_STAMP
TIME_STAMP
SEQ_NO
NAME_PREFIX
ID /list missing
out=a.full;
Regards,
S Ravuri.
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?
Options:
Use Proc freq with multiple tables statements creating multiple output data sets and then combine the output sets.
Use another procedure.
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;
run;
ods output close;
ods listing;
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 ...
http://www.nesug.org/Proceedings/nesug11/ds/ds12.pdf
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.