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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 695 views
  • 0 likes
  • 2 in conversation