Previous Page | Next Page

The TABULATE Procedure

Example 14: Specifying Style Elements for ODS Output


Procedure features:

STYLE= option in

PROC TABULATE statement

CLASSLEV statement

KEYWORD statement

TABLE statement

VAR statement

Other features:

ODS HTML statement

ODS PDF statement

ODS RTF statement

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

This example creates HTML, RTF, and PDF files and specifies style elements for various table regions.


Program

 Note about code
options nodate pageno=1;
 Note about code
ods html body='external-HTML-file';
ods pdf file='external-PDF-file';
ods rtf file='external-RTF-file';
 Note about code
proc tabulate data=energy style=[fontweight=bold];
 Note about code
   class region division type / style=[textalign=center];
 Note about code
   classlev region division type / style=[textalign=left];
 Note about code
   var expenditures / style=[fontsize=3];
 Note about code
   keyword all sum / style=[fontwidth=wide];
   keylabel all="Total";
 Note about code
   table (region all)*(division all*[style=[backgroundcolor=yellow]]),
         (type all)*(expenditures*f=dollar10.) / 
         style=[bordercolor=blue]
 Note about code
         misstext=[label="Missing" style=[fontweight=light]]
 Note about code
         box=[label="Region by Division by Type" 
            style=[fontstyle=italic]];
 Note about code
   format region regfmt. division divfmt. type usetype.;
 Note about code
   title 'Energy Expenditures';
   title2 '(millions of dollars)';
run;
 Note about code
ods html close;
ods pdf close;
ods rtf close;

Listing Output

                             Energy Expenditures                             1
                            (millions of dollars)

             ----------------------------------------------------
             |Region by        |        Type         |          |
             |Division by Type |---------------------|          |
             |                 |Residenti-|          |          |
             |                 |    al    | Business |          |
             |                 |Customers |Customers |  Total   |
             |                 |----------+----------+----------|
             |                 |Expenditu-|Expenditu-|Expenditu-|
             |                 |   res    |   res    |   res    |
             |                 |----------+----------+----------|
             |                 |   Sum    |   Sum    |   Sum    |
             |-----------------+----------+----------+----------|
             |Region  |Division|          |          |          |
             |--------+--------|          |          |          |
             |Northea-|New     |          |          |          |
             |st      |England |    $7,477|    $5,129|   $12,606|
             |        |--------+----------+----------+----------|
             |        |Middle  |          |          |          |
             |        |Atlantic|   $19,379|   $15,078|   $34,457|
             |        |--------+----------+----------+----------|
             |        |Total   |   $26,856|   $20,207|   $47,063|
             |--------+--------+----------+----------+----------|
             |West    |Division|          |          |          |
             |        |--------|          |          |          |
             |        |Mountain|    $5,476|    $4,729|   $10,205|
             |        |--------+----------+----------+----------|
             |        |Pacific |   $13,959|   $12,619|   $26,578|
             |        |--------+----------+----------+----------|
             |        |Total   |   $19,435|   $17,348|   $36,783|
             |--------+--------+----------+----------+----------|
             |Total   |Division|          |          |          |
             |        |--------|          |          |          |
             |        |New     |          |          |          |
             |        |England |    $7,477|    $5,129|   $12,606|
             |        |--------+----------+----------+----------|
             |        |Middle  |          |          |          |
             |        |Atlantic|   $19,379|   $15,078|   $34,457|
             |        |--------+----------+----------+----------|
             |        |Mountain|    $5,476|    $4,729|   $10,205|
             |        |--------+----------+----------+----------|
             |        |Pacific |   $13,959|   $12,619|   $26,578|
             |        |--------+----------+----------+----------|
             |        |Total   |   $46,291|   $37,555|   $83,846|
             ----------------------------------------------------

HTML Output

[HTML Output]


PDF Output

[PDF output]


RTF Output

[RTF output]

Previous Page | Next Page | Top of Page