How can I force the word "Total" for the summary line in the code below?
data a;
input x 1. y 1.;
datalines;
10
21
31
22
;
run;
proc format;
value grp
1='A'
2='B'
3='A'
;
proc report data=a;
col x n;
define x / group format=grp.;
define n / 'count';
compute before;
x = 'Total'; /*column or grand total*/
endcomp;
rbreak before / summarize;
run;
data a; input x 1. y 1.; datalines; 10 21 31 22 ; run; proc format; value grp 1='A' 2='B' 3='A' .='Total' ; proc report data=a nowd ; column x xx n; define x / group format=grp10. noprint ; define xx/computed; define n / 'count'; compute xx/character length=10; xx=put(x,grp8. -l); endcomp; rbreak before / summarize; run;
data a; input x 1. y 1.; datalines; 10 21 31 22 ; run; proc format; value grp 1='A' 2='B' 3='A' .='Total' ; proc report data=a nowd ; column x xx n; define x / group format=grp10. noprint ; define xx/computed; define n / 'count'; compute xx/character length=10; xx=put(x,grp8. -l); endcomp; rbreak before / summarize; run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.