BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
The last row gives the sum of each numeric column.
In the cell that occupies the first column and last row I would like to see the word "Total"
How do I accomplish this?
Thank you.

proc report data=test nowd out=test
style(header)=[font_weight=bold];
options missing='0';
column bu ydoi, (yr_tot);
define bu /group style(column)={just=l};
define ydoi /across '';
define yr_tot /analysis '' format=comma9.;
rbreak after / ol skip summarize;
run;
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
You would have a compute block, something like:
[pre]
compute after;
bu='Total';
endcomp;
[/pre]

The only complication is that the internal length of the BU variable must be big enough to hold the string "Total'. There are ways around it if BU is numeric or a length of 2 -- but the simple compute block above should work if the BU variable is character length of at least 5.

cynthia

ps...also, please do me a favor and move your OPTIONS statement outside of your PROC REPORT step. It just bothers me to see the OPTIONS statement in the wrong place.

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