Generating Column Totals

The SUM Statement

To produce column totals for numeric variables, you can list the variables to be summed in a SUM statement in your PROC PRINT step.
Syntax, SUM statement:
SUM variable(s);
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; 
   var name policy balancedue; 
   where pctinsured < 100;  
   sum balancedue; 
Column totals appear at the end of the report in the same format as the values of the variables.
Figure 5.9 Column Totals
Column Totals

Requesting Subtotals ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.