Example 5.5 Calculating Totals across a BY Group to Produce Cumulative and Grand Totals
Create in one DATA step two data sets that summarize information found in one data set. Create one data set that contains cumulative totals for observations within a BY group. Create another data set that collapses each BY group into a single observation and produces grand totals for variables in each BY group.
|Featured Step||DATA step|
|Featured Step Options and Statements||BY-group processing Accumulator variables|
|Related Technique||PROC SQL, GROUP BY clause, CASE expression, MAX and SUM functions|
Input Data Set
Data set TECHCERTIF contains certification-eligible events for five technologists.
TECHCERTIF event_ Obs techid event_date event_type ...