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;

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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
  • 458 views
  • 1 like
  • 2 in conversation