The SAS Output Delivery System and reporting techniques

Using PROC ODSTABLE to suppress rows in PROC FREQ

Reply
Contributor
Posts: 26

Using PROC ODSTABLE to suppress rows in PROC FREQ

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};

 

 

 

Grand Advisor
Posts: 9,699

Re: Using PROC ODSTABLE to suppress rows in PROC FREQ

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.

Contributor
Posts: 26

Re: Using PROC ODSTABLE to suppress rows in PROC FREQ

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).

Grand Advisor
Posts: 9,699

Re: Using PROC ODSTABLE to suppress rows in PROC FREQ

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;

Post a Question
Discussion Stats
  • 3 replies
  • 233 views
  • 0 likes
  • 2 in conversation