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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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