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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 543 views
  • 0 likes
  • 2 in conversation