BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

In this proc report example I want that  in last row under Y column will be empty cell (and not 150 value)

What is the way to do it please?

I want also that in last row under "t" column will written "All" and not empty cell 

 

data tbl1;
input ID t $ X Y;
cards;
1 a 10 150
2 a 20 150
3 a 30 150
4 b 40 150
5 b 50 150
;
run;

proc report data=tbl1;
columns  t x y ;
define t/group;
define x/sum;
define y/max;

rbreak after /summarize ol ul;

run;
1 REPLY 1
Kurt_Bremser
Super User

Then why do you tell proc report to calculate a max, when you don't want it?

Try this:

proc report data=tbl1;
columns  t x y ;
define t/group;
define x/sum;
define y/display;

rbreak after /summarize ol ul;
compute after;
  t = 'Total';
endcomp;

run;

Result:

t                 X          Y
a                10        150
                 20        150
                 30        150
b                40        150
                 50        150
--------  ---------           
Total           150           
--------  ---------           

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 553 views
  • 0 likes
  • 2 in conversation