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.
|
options nodate pageno=1; |
|
ods html body='external-HTML-file';
ods pdf file='external-PDF-file';
ods rtf file='external-RTF-file'; |
|
proc tabulate data=energy style=[fontweight=bold]; |
|
class region division type / style=[textalign=center]; |
|
classlev region division type / style=[textalign=left]; |
|
var expenditures / style=[fontsize=3]; |
|
keyword all sum / style=[fontwidth=wide];
keylabel all="Total"; |
|
table (region all)*(division all*[style=[backgroundcolor=yellow]]),
(type all)*(expenditures*f=dollar10.) /
style=[bordercolor=blue] |
|
misstext=[label="Missing" style=[fontweight=light]] |
|
box=[label="Region by Division by Type"
style=[fontstyle=italic]]; |
|
format region regfmt. division divfmt. type usetype.; |
|
title 'Energy Expenditures';
title2 '(millions of dollars)';
run; |
|
ods html close;
ods pdf close;
ods rtf close; |
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|
----------------------------------------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.