Basic Column Totals
With the help of SUM statement we can generate total value of columns. SUM statement is used in PROC PRINT step.
To generate Subtotals, we shall add both SUM statement and BY statement in PROC PRINT step.
Subtotals with ID
We can use ID statement if we do not wish to display Obs.
Subtotals on Separate Pages
PAGEBY statement is used to print BY groups of the variable(variable used for sorting) separately. The groups appear on separate pages. The horizontal lines show the demarcation of pages.
Note: The displayed pictures for result – Column totals and Subtotals on Separate Pages are cropped and do not show the complete result for aesthetic reasons.