BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello All

I am trying to generate a dataset for the output of the PROC FREQ. I am trying to use the output option but it is erroring out saying it needs a statistic where I need only the freq.

Here is the code:
proc freq data = sshh.sshh_data4;
tables rspnsby_cntr_id;
output out = sshh.sshh_data10;
run;

The message in the log is:

WARNING: No OUTPUT data set is produced because no statistics are requested in the corresponding
TABLES statement.


So I have 2 questions:
1. How do I generate the dataset?
2. If the above is the only way what do I have to specify as the statistic to get the freq counts?

Thanks
Pappu.
3 REPLIES 3
GertNissen
Barite | Level 11
Try:

proc freq data = sshh.sshh_data4;
tables rspnsby_cntr_id / out = sshh.sshh_data10;
run;

http://support.sas.com/onlinedoc/913/getDoc/en/procstat.hlp/freq_sect10.htm#basestat_freq_freqout
LinusH
Tourmaline | Level 20
Well, you have to specify a statistic on the tables or the output statement, according to the online doc. You are probably interested in the N statistic. But if you just want the freq, you could always do the same in PROC SQL using count and group by.

/Linus

http://support.sas.com/documentation/cdl/en/procstat/59629/HTML/default/procstat_freq_sect009.htm
Data never sleeps
deleted_user
Not applicable
Thanks for all the inputs - both methods work....

I really appreciate your time.

Pappu.

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 7331 views
  • 2 likes
  • 3 in conversation