BookmarkSubscribeRSS Feed
odmhx
Calcite | Level 5
I am using 'holding variables' to compute and display multiple summaries at the end of the report and don't know how to order them the way I want.

I want:

regular total: 123,457.00
bccp total: 1,230.00
mfp total: 3,210.00
total: 127,697.00

but the output report always displays as

mfp total: 3,210.00
bccp total: 1,230.00
regular total: 123,457.00
total: 127,697.00

My code:
break after regular/sumarize;
compute after regular;
ffp_type = 'regular total: ';
reimb.sum = regsum;
endcomp;

break after bccp/sumarize;
compute after bccp;
ffp_type = 'bccp total: ';
reimb.sum = bccpsum;
endcomp;

break after mfp/sumarize;
compute after mfp;
ffp_type = 'mfp total: ';
reimb.sum = mfpsum;
endcomp;

rbreak after /summarize;
compute after;
ffp_type = 'total: ';
reimb.sum = grandtot;
endcomp;

Can you help me?

Thanks a lot! Message was edited by: odmhx
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
I believe that the COLUMNS statement controls the sequence of variable sort-order, so the right-most variable in the COLUMNS statement will "break" first, and so your final set (at RBREAK) of summary rows will have influenced by the COLUMS variable list. Suggest you share the rest of your PROC REPORT code in future posts / replies using COPY/PASTE, ideally as it is executed (from the SAS log) especially when diagnostic messages are meaningful.

Scott Barry
SBBWorks, Inc.
odmhx
Calcite | Level 5
> I believe that the COLUMNS statement controls the
> sequence of variable sort-order, so the right-most
> variable in the COLUMNS statement will "break" first,
> and so your final set (at RBREAK) of summary rows
> will have influenced by the COLUMS variable list.
> Suggest you share the rest of your PROC REPORT code
> in future posts / replies using COPY/PASTE, ideally
> as it is executed (from the SAS log) especially when
> diagnostic messages are meaningful.
>
> Scott Barry
> SBBWorks, Inc.


Thank you so much! Yes, you are right. I reversed the columns order and they turned out correct.
I will include more of my code in the future whenever i ask question here. But I found that that alignment of the statements is always screwed up, and may make my message even less readable.... Message was edited by: odmhx

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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