BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Q1983
Lapis Lazuli | Level 10

 

data test;

length ctr $25.;

infile datalines;

input ctr $ Division $ cnt cnt2;

return;

datalines;

 

Timely Central 5 15

Timely Northern 1 12

Not_Timely Central 3 154

Timely Atlantic 15 66

Not_Timely Atlantic 1 66

Not_Timely Atlantic 2 66

Timely Central 25 66

Timely Central 6 666

Timely Northern 11 42

;

run;

 

 

proc report = test nowd style(summary)=Header;

column ctr Division cnt cnt2 rtot;

define ctr /group ;

define Division /group ;

define cnt /sum f=comma6.;

define cnt2 /sum f=comma6.;

define RTot /computed f=comma16. "Row Totals";

compute RTot;

RTot=sum(cnt.sum,cnt2.sum);/*row_tot*/

endcomp;

compute before;

 

sum=cnt.sum;

sum=cnt2.sum;

endcomp;

compute after;

 

ctr='Grand Total';

endcomp;

rbreak after /summarize;

run;

 

I want to place a group total after ctr changes.  There are two possibilities (timely and not_timely)  I want to place row total after each instance

 

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Add next line before the rbreak line:

break after ctr / ol summarize skip;

View solution in original post

1 REPLY 1
Shmuel
Garnet | Level 18

Add next line before the rbreak line:

break after ctr / ol summarize skip;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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