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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.