The SAS Output Delivery System and reporting techniques

Putting "Total" in the output from proc print and a sum statement

Reply
Occasional Contributor
Posts: 15

Putting "Total" in the output from proc print and a sum statement

I have the following code:

proc print label noobs data=surv1;

var responsec count1 pct1;

sum count1 pct1;

label responsec='Response'

          count1='N'

          pct1='Pct';           

run;

The output looks like this:

Response                                 N   Pct

1-Strongly disagree1116%
2-Disagree812%
3-Neither agree nor disagree3044%
4-Agree1015%
5-Strongly agree913%
  68100%

Is there a way to add the word "Total" in the last line under "Response"?

SAS Super FREQ
Posts: 8,645

Re: Putting "Total" in the output from proc print and a sum statement


Hi:

  Look in the PROC PRINT documentation. There is a SUMLABEL= option and a GRANDTOTAL_LABEL= option that can be used. It depends on whether you have BY group processing in the PROC PRINT step or not. Typically, SUMLABEL would be for subgroups and GRANDTOTAL_LABEL would be for the bottom of the report. And if you're not using BY group processing, then you might want to switch to PROC REPORT in order to put some text on the final summary line on the report.

cynthia

Post a Question
Discussion Stats
  • 1 reply
  • 324 views
  • 0 likes
  • 2 in conversation