|The Complete Guide to the SAS Output Delivery System|
By default, ODS output is formatted according to instructions that the procedure or DATA step points to. However, ODS provides ways for you to customize the output. You can customize the output for an entire SAS job, or you can customize the output for a single output object.
|Style Definitions, Style Elements, and Style Attributes|
To customize the output at the level of the entire SAS job, you specify a style definition. A style definition describes how to render the presentation aspects (color, font face, font size, and so forth) of an entire SAS job. A style definition determines the overall look of the documents that use it.
Each style definition is composed of style elements. A style element is a collection of style attributes that apply to a particular part of the output. For instance, a style element may contain instructions for the presentation of column headers or for the presentation of the data inside cells. Style elements may also specify default colors and fonts for output that uses the style definition.
Each style attribute specifies a value for one aspect of the presentation. For instance, the BACKGROUND= attribute specifies the color for the background of an HTML table or for a colored table in Printer output. The FONT_STYLE= attribute specifies whether to use a Roman, a slant, or an italic font. For information on style attributes, see Style Attributes.
Because style definitions control the presentation
of the data, they have no affect on output objects that go to the Listing
or Output destination.
|Table Definitions, Table Elements, and Table Attributes|
A table definition describes how to render the output for a tabular output object. (Almost all ODS output is tabular.) A table definition determines the order of column headers and the order of variables, as well the overall look of the output object that uses it.
In addition to the parts of the table definition that order the headers and columns, each table definition contains or references table elements. A table element is a collection of table attributes that apply to a particular header, footer, or column. Typically, a table attribute specifies something about the data rather than about its presentation. For instance FORMAT specifies the SAS format to use in a column. However, some table attributes describe presentation aspects of the data.
The parts of table definitions that
control the presentation of the data have no affect on output objects that
go to the Listing or Output destination. However, the parts that control the
structure of the table and the data values do affect Listing output.
For information on table attributes, see Table Attributes.
|Customizing Presentation Aspects of ODS Output|
To specify a style definition for your ODS output, use the STYLE= option in the ODS statement for the destination or destinations that you are using (see Appending to HTML Files). Note that you must specify the option for each destination. Your site may have its own customized style definitions that are used for all HTML and Printer output to give the output a consistent appearance.
Some of the standard style definitions that are currently shipped with the SAS System include
To find an up-to-date list of the style definitions:
Operating Environment Information: For information on navigating in the Explorer window without a mouse, see the section on "Window Controls and General Navigation" in the SAS documentation for your operating environment.
You can also display a list of the available styles by submitting the following PROC TEMPLATE step:
proc template; list styles; run;
You can create your own style definitions or modify existing ones with PROC TEMPLATE (see The TEMPLATE Procedure).
|Customizing Output for a Tabular Output Object|
For a procedure, the name of the table definition that is used for an output object comes from the procedure code. The DATA step uses a default table definition unless you specify an alternative with the TEMPLATE= suboption in the ODS option in the FILE statement (see the discussion of TEMPLATE=).
To find out which table definitions a procedure or the DATA step uses for the output objects that it creates, look at a trace record. To produce a trace record in your SAS log, submit the following SAS statements:
ods trace on; your-proc-or-DATA-step ods trace off;
The trace record refers to the table definition as a template. For a detailed explanation of the trace record, see Contents of the Trace Record.
Remember that not all
procedures use a table definition.
If you produce a trace record for one of these procedures, no definition appears
in the trace record.
You can use PROC TEMPLATE to modify a table definition as a whole, but, in general, you can't directly specify a table element for your procedure or DATA step to use without modifying the definition itself. When a procedure or DATA step uses a table definition, it uses the table elements that that definition defines or references.
base procedures, PROC REPORT and PROC TABULATE, do provide a way for you to
access table elements from the procedure step itself. Accessing the table
elements enables you to do such things as specify background colors for certain
cells, change the font face for column headers, and so forth. For more information,
consult "Customizing the Style Definition that ODS Uses" in Chapter
2 of SAS Procedures Guide, as well as the documentation for these two procedures in the
Top of Page
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.