Previous Page | Next Page

The TABULATE Procedure

Example 9: Creating Multipage Tables


Procedure features:

TABLE statement

ALL class variable

BOX=

CONDENSE

INDENT=

page expression

Data set: ENERGY
Formats: REGFMT., DIVFMT., and USETYPE.

This example creates a separate table for each region and one table for all regions. By default, PROC TABULATE creates each table on a separate page, but the CONDENSE option places them all on the same page.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc tabulate data=energy format=dollar12.;
 Note about code
   class region division type;
 Note about code
   var expenditures;
 Note about code
   table region='Region: ' all='All Regions',
 Note about code
   division all='All Divisions',
 Note about code
         type='Customer Base'*expenditures=' '*sum=' '
 Note about code
         / rts=25 box=_page_ condense indent=1;
 Note about code
   format region regfmt. division divfmt. type usetype.;
 Note about code
   title 'Energy Expenditures for Each Region and All Regions';
   title2 '(millions of dollars)';
run;

Output

              Energy Expenditures for Each Region and All Regions              1
                             (millions of dollars)

              ---------------------------------------------------
              |Region: Northeast      |      Customer Base      |
              |                       |-------------------------|
              |                       |Residential |  Business  |
              |                       | Customers  | Customers  |
              |-----------------------+------------+------------|
              |New England            |      $7,477|      $5,129|
              |-----------------------+------------+------------|
              |Middle Atlantic        |     $19,379|     $15,078|
              |-----------------------+------------+------------|
              |All Divisions          |     $26,856|     $20,207|
              ---------------------------------------------------


              ---------------------------------------------------
              |Region: West           |      Customer Base      |
              |                       |-------------------------|
              |                       |Residential |  Business  |
              |                       | Customers  | Customers  |
              |-----------------------+------------+------------|
              |Mountain               |      $5,476|      $4,729|
              |-----------------------+------------+------------|
              |Pacific                |     $13,959|     $12,619|
              |-----------------------+------------+------------|
              |All Divisions          |     $19,435|     $17,348|
              ---------------------------------------------------


              ---------------------------------------------------
              |All Regions            |      Customer Base      |
              |                       |-------------------------|
              |                       |Residential |  Business  |
              |                       | Customers  | Customers  |
              |-----------------------+------------+------------|
              |New England            |      $7,477|      $5,129|
              |-----------------------+------------+------------|
              |Middle Atlantic        |     $19,379|     $15,078|
              |-----------------------+------------+------------|
              |Mountain               |      $5,476|      $4,729|
              |-----------------------+------------+------------|
              |Pacific                |     $13,959|     $12,619|
              |-----------------------+------------+------------|
              |All Divisions          |     $46,291|     $37,555|
              ---------------------------------------------------

Previous Page | Next Page | Top of Page