An Idea Exchange for SAS software and services

by Trusted Advisor
on ‎05-23-2014 09:14 PM

I like the idea, however, it should probably also be available at the tables scope rather than just the proc scope.

by Occasional Contributor RoyPardee
on ‎05-24-2014 01:47 PM


If I'm interpreting you correctly, I think the table scope is reasonably easily achieved w/a dset option spec--e.g.

  proc freq data = dx_data (obs = 1000) order = freq ;

   tables dx_code / missing ;

  run ;

You buy that?

by Trusted Advisor
on ‎05-24-2014 04:40 PM

proc freq data=foo row_limit=10;

tables dx_code / missing; * produces 10 results from proc scope setting;

tables ox_code / row_limit=5; *override proc scope with table scope to receive 5 for this frequency table;


by Occasional Contributor RoyPardee
on ‎05-26-2014 03:12 PM

Oooo--gotcha.  That's a great idea--in fact, if we have it at the TABLES level, then maybe we don't need it at the PROC level at all?

by Super User
on ‎05-28-2014 02:21 PM

But what will you do when you have say 5 values that tie for the 10th place? You're only going to get one of them unless you have some kind of TIES option.

by Occasional Contributor RoyPardee
on ‎05-28-2014 03:54 PM

That's a good question.  For my part, I don't much care--I'm explicitly asking to not see every single value & so only seeing one (arbitrarily chosen) of the ties would be just fine with me.

by Contributor moreka
on ‎06-18-2014 12:49 PM

This would be extremely useful!

Getting an output of 1 page with the most frequently occurring billing codes, for example, would be infinitely preferable to 150 pages with codes that only show up once.


by Regular Contributor
on ‎06-18-2014 12:59 PM

proc freq data = dx_data order = freq noprint ;

    tables dx_code / missing nocum nopercent out=dx_data_freq;

   run ;

proc print data=dx_data_freq(obs=10); run;

This prints the top ten most frequent dx_codes however, it does not account for duplicate frequencies when two or more dx_codes have the same frequency counts.  Adding a feature to Proc Freq would save the Proc Print step.

by Contributor moreka
on ‎06-18-2014 01:02 PM

Great solution jwillis, thanks!

by Occasional Contributor RoyPardee
on ‎06-18-2014 01:07 PM

The proposal would also show cross-tab values (if specified) and preserve the output formatting you get with FREQ.  I don't think the two-step approach you're suggesting would do that.

Idea Statuses
Top Liked Authors