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

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