O'Reilly logo

SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating Column Totals

Overview

To produce column totals for numeric variables, you can list the variables to be summed in a SUM statement in your PROC PRINT step.
General form, SUM statement:
SUM variable(s);
where variable(s) is one or more numeric variable names, separated by blanks.
The SUM statement in the following PROC PRINT step requests column totals for the variable BalanceDue:
proc print data=clinic.insure; 
   var name policy balancedue; 
   where pctinsured < 100;  
   sum balancedue; 
run;
Column totals appear at the end of the report in the same format as the values of the variables.
Column Totals
Column Totals

Requesting Subtotals ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required