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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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