Hi:
In order for PROC REPORT to give you a SUM, you need to tell it (in your DEFINE statement) to use a variable as an analysis variable. You have this:
[pre]
define perc/display 'Percent';
[/pre]
When PROC REPORT sees the usage of DISPLAY, it explicitly does NOT give you a SUM on that column. So you need to change the usage from DISPLAY to ONE of these DEFINE statements:
[pre]
define perc/analysis 'Percent';
define perc/analysis sum 'Percent';
define perc/sum 'Percent';
[/pre]
Any one of those versions of the statement would work for you.
1 -- because the default statistic for the analysis usage is SUM
2 -- because you are explicitly specifying the analysis usage and the statistic
3 -- because when you specify a statistic, the usage of analysis is assumed
In order to "rename" the contract id at the break, a compute block will essentially take what's in the field at the break and rename it (this code assumes that contract id is a character variable -- you'd have to do something different if it was a numeric variable):
[pre]
compute after cont_id;
cont_id = 'Subtotal';
endcomp;
[/pre]
This compute block can go anywhere in your PROC REPORT program. For readability purposes, I recommend putting it under the BREAK statement, so you know that a COMPUTE block will execute at the BREAK.
If you were sending output to the LISTING window, then you could add the SKIP option to your BREAK statement to get a skipped line after the summarized report row:
[pre]
BREAK AFTER cont_id / SUMMARIZE DUL DOL SKIP ;
[/pre]
However, SKIP is ignored for ODS HTML, RTF and PDF, so you have to make one more change to your COMPUTE block -- by adding a LINE statement to insert a blank line after the summary line:
[pre]
compute after cont_id;
cont_id = 'Subtotal';
line ' ';
endcomp;
[/pre]
For more help with PROC REPORT syntax, the on-line documentation and help files are very thorough and have some good examples. Or, you can contact Tech Support for help with your particular data and specific processing need.
cynthia