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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: