PRINT Procedure

SUMBY Statement

Limits the number of sums that appear in the report.
Requirement: BY statement
Limiting the Number of Sums in a Report


SUMBY BY-variable;

Required Argument

identifies a variable that appears in the BY statement in the PROC PRINT step. If the value of the BY variable changes, or if the value of any BY variable that precedes it in the BY statement changes, PROC PRINT prints the sums of all variables listed in the SUM statement.


What Variables Are Summed?

If you use a SUM statement, PROC PRINT subtotals only the SUM variables. Otherwise, PROC PRINT subtotals all the numeric variables in the data set except for the variables listed in the ID and BY statements.