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
SAS Super FREQ
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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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