BookmarkSubscribeRSS Feed
MattehWoo
Calcite | Level 5

Hi all,

 

I have a report that i've ran using Proc Report.

 

I want to summarize the data which i have done using:

 

rbreak after / dol skip summarize;

compute after; 

     Column='TOTAL';

endcomp;

 

Now this sums everything however, i have some columns that are average %s.

 

Is it possible to sum the columns with numbers but average the columns with the average percentages, or atleast blank them out, as at the moment the sum is showing 5000%+ which just looks well, dirty.

 

Any help is much appreciated.

 

Cheers,

 

Matt

3 REPLIES 3
ballardw
Super User

Incomplete code without data may lead to incomplete answers.

 

You could at least show your entire current code. Best would be to include some example data.

 

Averaging rates, such as percentages, is seldom appropriate.

Cynthia_sas
SAS Super FREQ
Hi:
Many things are possible with PROC REPORT. Here's a paper on BREAK processing https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf that may show you some techniques. And while this is a silly example http://support.sas.com/kb/38/776.html that changes age, height and weight variables to have a dollar format, it does show how you can use CALL DEFINE to change a format.

One reason you might be getting inflated percent numbers in the thousands is that if you are using the PERCENT format (which we can't see because you're not showing all your code) be aware that the PERCENT format does an automatic multiply by 100.

Your code snippet is interesting, but not helpful. You don't show any data. Or what ODS destination you're interested in DOL and SKIP are LISTING only options that will be ignored by ODS HTML, ODS RTF, ODS PDF and ODS EXCEL.

Cynthia

PaigeMiller
Diamond | Level 26

If ind that if you first do the math (average or totals or percentages) in PROC SUMMARY, then PROC REPORT works very nicely and easily.

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1307 views
  • 0 likes
  • 4 in conversation