BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Batman
Quartz | Level 8

 

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
 

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;

View solution in original post

1 REPLY 1
Ksharp
Super User
 

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;
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1003 views
  • 1 like
  • 2 in conversation