| Creating List Reports |
| Generating Column
Totals |
| 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:
where variable(s) is one or more variable names, separated by blanks. You do not need to name the variables in a VAR statement if you specify them in the SUM statement. |
The SUM statement in the following PROC PRINT step requests column totals for the variable Fee:
proc print data=clinic.admit;
var age height weight fee;
where age>30;
sum fee;
run;
Column totals appear at the end of the report in the same format as the values of the variables. |
| Obs | Age | Height | Weight | Fee |
| 2 | 34 | 66 | 152 | 124.80 |
| 3 | 31 | 61 | 123 | 149.75 |
| 4 | 43 | 63 | 137 | 149.75 |
| 5 | 51 | 71 | 158 | 124.80 |
| 7 | 32 | 67 | 151 | 149.75 |
| 8 | 35 | 70 | 173 | 149.75 |
| 9 | 34 | 73 | 154 | 124.80 |
| 10 | 49 | 64 | 172 | 124.80 |
| 11 | 44 | 66 | 140 | 149.75 |
| 14 | 40 | 69 | 163 | 124.80 |
| 15 | 47 | 72 | 173 | 124.80 |
| 16 | 60 | 71 | 191 | 149.75 |
| 17 | 43 | 65 | 123 | 124.80 |
| 20 | 41 | 67 | 141 | 149.75 |
| 21 | 54 | 71 | 183 | 149.75 |
| 2071.60 |
![]() ![]() |
|
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.