Previous Page | Next Page

The TABULATE Procedure

Example 3: Using Preloaded Formats with Class Variables


Procedure features:

PROC TABULATE statement option:

OUT=

CLASS statement options:

EXCLUSIVE

PRELOADFMT

TABLE statement option:

PRINTMISS

Other features: PRINT procedure
Data set: ENERGY
Formats: REGFMT., DIVFMT., and USETYPE.

This example


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 / preloadfmt;
 Note about code
   var expenditures;
 Note about code
   table region*division,
         type*expenditures / rts=25 printmiss;
 Note about code
   format region regfmt. division divfmt. type usetype.;
 Note about code
   title 'Energy Expenditures for Each Region';
   title2 '(millions of dollars)';
run;
 Note about code
proc tabulate data=energy format=dollar12. out=tabdata;
 Note about code
   class region division type / preloadfmt exclusive;
 Note about code
   var expenditures;
 Note about code
   table region*division,
         type*expenditures / rts=25;
 Note about code
   format region regfmt. division divfmt. type usetype.;
 Note about code
   title 'Energy Expenditures for Each Region';
   title2 '(millions of dollars)';
run;
 Note about code
proc print data=tabdata;
run;

Output

                      Energy Expenditures for Each Region                      1
                             (millions of dollars)

              ---------------------------------------------------
              |                       |          Type           |
              |                       |-------------------------|
              |                       |Residential |  Business  |
              |                       | Customers  | Customers  |
              |                       |------------+------------|
              |                       |Expenditures|Expenditures|
              |                       |------------+------------|
              |                       |    Sum     |    Sum     |
              |-----------------------+------------+------------|
              |Region     |Division   |            |            |
              |-----------+-----------|            |            |
              |Northeast  |New England|      $7,477|      $5,129|
              |           |-----------+------------+------------|
              |           |Middle     |            |            |
              |           |Atlantic   |     $19,379|     $15,078|
              |           |-----------+------------+------------|
              |           |Mountain   |           .|           .|
              |           |-----------+------------+------------|
              |           |Pacific    |           .|           .|
              |-----------+-----------+------------+------------|
              |South      |New England|           .|           .|
              |           |-----------+------------+------------|
              |           |Middle     |            |            |
              |           |Atlantic   |           .|           .|
              |           |-----------+------------+------------|
              |           |Mountain   |           .|           .|
              |           |-----------+------------+------------|
              |           |Pacific    |           .|           .|
              |-----------+-----------+------------+------------|
              |Midwest    |New England|           .|           .|
              |           |-----------+------------+------------|
              |           |Middle     |            |            |
              |           |Atlantic   |           .|           .|
              |           |-----------+------------+------------|
              |           |Mountain   |           .|           .|
              |           |-----------+------------+------------|
              |           |Pacific    |           .|           .|
              |-----------+-----------+------------+------------|
              |West       |New England|           .|           .|
              |           |-----------+------------+------------|
              |           |Middle     |            |            |
              |           |Atlantic   |           .|           .|
              |           |-----------+------------+------------|
              |           |Mountain   |      $5,476|      $4,729|
              |           |-----------+------------+------------|
              |           |Pacific    |     $13,959|     $12,619|
              ---------------------------------------------------
                      Energy Expenditures for Each Region                      2
                             (millions of dollars)

              ---------------------------------------------------
              |                       |          Type           |
              |                       |-------------------------|
              |                       |Residential |  Business  |
              |                       | Customers  | Customers  |
              |                       |------------+------------|
              |                       |Expenditures|Expenditures|
              |                       |------------+------------|
              |                       |    Sum     |    Sum     |
              |-----------------------+------------+------------|
              |Region     |Division   |            |            |
              |-----------+-----------|            |            |
              |Northeast  |New England|      $7,477|      $5,129|
              |           |-----------+------------+------------|
              |           |Middle     |            |            |
              |           |Atlantic   |     $19,379|     $15,078|
              |-----------+-----------+------------+------------|
              |West       |Mountain   |      $5,476|      $4,729|
              |           |-----------+------------+------------|
              |           |Pacific    |     $13,959|     $12,619|
              ---------------------------------------------------
                                                                               3

                                                                           E
                                                                           x
                                                                           p
                                                                           e
                                                                           n
                                                                           d
                                                                           i
                                                                           t
                 D                                                         u
                 i                                                   _     r
     R           v                                          _    _   T     e
     e           i                                          T    P   A     s
     g           s                           T              Y    A   B     _
 O   i           i                           y              P    G   L     S
 b   o           o                           p              E    E   E     u
 s   n           n                           e              _    _   _     m

 1   Northeast   New England       Residential Customers   111   1   1    7477
 2   Northeast   New England       Business Customers      111   1   1    5129
 3   Northeast   Middle Atlantic   Residential Customers   111   1   1   19379
 4   Northeast   Middle Atlantic   Business Customers      111   1   1   15078
 5   West        Mountain          Residential Customers   111   1   1    5476
 6   West        Mountain          Business Customers      111   1   1    4729
 7   West        Pacific           Residential Customers   111   1   1   13959
 8   West        Pacific           Business Customers      111   1   1   12619

Previous Page | Next Page | Top of Page