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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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