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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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