Chapter Contents

Previous

Next
The PRINT Procedure

Example 6: Limiting the Number of Sums in a Report


Features:
BY statement
SUM statement
SUMBY statement
Other features:
SORT procedure
LABEL statement
Data set: EXPREV

This example



Program

options nodate pageno=1 linesize=70 pagesize=60;
 Note about code
proc sort data=exprev;
   by region state;
run;
 Note about code
proc print data=exprev noobs;
 Note about code
   by region state;
   sum revenues expenses;
   sumby region;

 Note about code
   label region='Sales Region';

 Note about code
   format revenues expenses comma10.;
   title 'Revenue and Expense Figures for Each Region';
run;


Output
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. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.