BookmarkSubscribeRSS Feed
newtolinux
Obsidian | Level 7

Hi, we have a business requirement to suppress the output for PROC FREQ output rows where the value for Frequency is le 10.

This applies to Frequency, Percent, Cum Freq and Cum Pct. I'm having trouble figuring out how to do this in Proc Odstable. I'm able to suppress the COLUMN named Freq, but would like the other columns suppressed as well. Any suggestions?

 

sample code:

 

cellstyle
_DATANAME_ = "Frequency" and _val_ le (10) as {DataEmpty},
mod(_row_,2) as {Background=Honeydew};

 

 

 

3 REPLIES 3
ballardw
Super User

Could you provide an example of your starting summary data and the desired output? I'm not quite sure what you may be wanting with the cumulative counts and percents. Are you making an attempt to disguise the fact that there are categories with fewer than 10? I know I would get somewhat questionable looks with a table where the displayed counts didn't add up to the cumulative displayed.

newtolinux
Obsidian | Level 7

It's pretty straightforward, actually. if you are summarizing the number of x in zipcode 12345 and the frequency is less than 10, then we need to suppress the frequency count as well as the other columns so that someone reading the table could not "back into" the number. The data is highly confidential and the concern about totals adding up is not relevant in this case. (but a good point, nonetheless).

ballardw
Super User

Depending on your other requirements it may be easier to summarize to a data set and then print

 

Proc freq data=have noprint;

   tables zipcode / out=zipfreq (where=(count ge 10));

run;

 

proc print data=zipfreq noobs;

run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1447 views
  • 0 likes
  • 2 in conversation