Contributor
Posts: 35

# How to order the computed summary

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
Super Contributor
Posts: 3,176

## Re: How to order the computed summary

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.
Contributor
Posts: 35

## Re: How to order the computed summary

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