DATA Step, Macro, Functions and more

Out Parameter in PROC FREQ

Reply
Contributor
Posts: 42

Out Parameter in PROC FREQ


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.

Super User
Posts: 11,343

Re: Out Parameter in PROC FREQ

Posted in reply to sambasiva_ravuri_tcs_com

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.

Valued Guide
Posts: 765

Re: Out Parameter in PROC FREQ

Posted in reply to sambasiva_ravuri_tcs_com

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_Smiley Happy;

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


Ask a Question
Discussion stats
  • 2 replies
  • 253 views
  • 1 like
  • 3 in conversation