BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am working with proc report to summarize a large amount of data. When the summary line summarizes to zero I would like to omit that line (still using proc report). Is this possible?

I have tried ommitting where line equals zero but this does not include all data in the final output.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
I do not believe that what you want to do is possible. Your best bet for help is to contact Tech Support for possible other approaches (like a DATA _NULL_ report, or making 2 passes through the data.

If PROC REPORT is doing the BREAK on the summary, you cannot suppress the break conditionally. If you are writing out a custom break line, you cannot execute the LINE statment conditionally -- you can only set a text string whose value is set conditionally:
[pre]
compute after brkvar;
if sales.sum = 0 then text_str = ' ';
else text_str = 'Sales: '||put(sales.sum,dollar14.);
line text_str $char50.;
endcomp;
[/pre]
in which case SOMETHING is still being written at the break -- but not being completely suppressed.

cynthia

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
  • 1 reply
  • 738 views
  • 0 likes
  • 2 in conversation