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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 1160 views
  • 0 likes
  • 2 in conversation