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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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