The SAS Output Delivery System and reporting techniques

Totalling in proc report issue/not working

Reply
Frequent Contributor
Posts: 135

Totalling in proc report issue/not working

Data app_summary2;

Set app_summary;

Run;

 

Sample data output

Loan_Officer          ID         PCT4      stp1                      ln

SMITH                   a100       80%        4                              5

SAMPSON           B50         20%        1                              5

FRANKLIN           C100      50%        1                              2

BALDWIN             D10        0%          0                              5

GRAND TOTAL

 

MY PROC REPORT IS BELOW.

 

I NEED TO TOTAL THE PCT4(PERCENT COLUMN AND REFLECT THE AVG IN THIS CASE 37%

I ALSO NEED TO TOTAL THE STP1 AND LN COLUMNS FOR A GRAND TOTAL AT THE BOTTOM

I DID AN RBREAK AT THE BOTTOM HOWEVER NO TOTALS APPEAR                                                                           

 

PROC REPORT DATA= app_summary2 headskip split='*' wrap nowd

 

           style(column)=[background=white font_size=10pt bordercolor=black borderwidth=1]

          

           ;

 

COLUMN LOAN_OFFICER RACF_ID pct4 stp1 ln;     

         

    

 

           DEFINE  LOAN_OFFICER /  Display style(column)={cellwidth=80pt just=right} "Loan Officer";

           DEFINE  ID /  Display style(column)={cellwidth=80pt just=right} "LO_RACF";

           DEFINE  pct4    /  Display style(column)={cellwidth=80pt just=right} "Sum of % Sent to Processing";

           DEFINE  stp1    / sum Display style(column)={cellwidth=120pt just=right} "Sum of SENT_TO_PROC_BY_END_RPT_MO";

           DEFINE  ln / sum Display style(column)={cellwidth=80pt just=right} "Sum of CT_LN_NBR";

           rbreak after /summarize;

 

compute after;

 

    stp1 = 'Total';

     /*ln = 'Total';*/

 

endcomp;

          

FOOTNOTE1 justify=Left Height=8pt "&FNote1";

           FOOTNOTE2 justify=Left Height=8pt "&ReportName";

          

 

          

           run;

SAS Super FREQ
Posts: 8,819

Re: Totalling in proc report issue/not working

Hi:
Numbers only appear for analysis items. PCT4, STP1 and LN are all given either DISPLAY or SUM DISPLAY as the usage. SUM DISPLAY is not really the usage you want. You want one (ANALYSIS SUM or just SUM) or the OTHER (DISPLAY), but not both. Since DISPLAY is the last usage listed in the DEFINE statement it "wins". I'm not sure I understand what numbers you want to see, but if you want to see an average on the summary line for PCT4, then instead of DISPLAY, I would recommend a usage of MEAN. Although I note that all of your labels use the word "Sum" so perhaps your statement that you wanted an average was just a typo.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 98 views
  • 0 likes
  • 2 in conversation