Features: |
BY statement |
SUM statement |
SUMBY statement |
|
Other features: |
SORT procedure |
LABEL statement |
|
Data set: |
EXPREV
|
This example
- creates a separate section of the report for each combination
of state and region
- sums expenses and revenues only for each region and for all regions,
not for individual states.
options nodate pageno=1 linesize=70 pagesize=60;
|
proc sort data=exprev;
by region state;
run; |
| proc print data=exprev noobs;
|
| by region state;
sum revenues expenses;
sumby region;
|
| label region='Sales Region';
|
| format revenues expenses comma10.;
title 'Revenue and Expense Figures for Each Region';
run; |
The report uses default column headers (variable names) because neither
the SPLIT= nor the LABEL option is used. Nevertheless, the BY line at the
top of each section of the report shows the BY variables' labels and their
values. The name of a BY variable identifies the subtotals in the report.
|
|
|
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.