Working with ODS Destinations and Styles

ODS destinations determine where your SAS/GRAPH output is sent. For example, the HTML destination sends output to an HTML file (by default), and the LISTING destination sends output to the GRAPH window. By default, ODS styles determine the overall appearance of your output.

Opening and Closing Destinations

A destination is a designation that ODS uses to determine where to send your output. Valid destinations include HTML (by default) , LISTING (the GRAPH window), RTF, and PDF, but other destinations are also available. Depending on the options available for the destination, you can specify options such as the filename or the path to an output directory.
To generate output, a valid ODS destination must be open. By default, the HTML destination is open, but you can open other destinations as needed by specifying an ODS destination statement. Your output is sent to all destinations that are open, so you can, for example, create HTML and PDF output by submitting your code only once. With the exceptions of the HTML and LISTING destinations, you must also close the destination before output is generated.
Here is the general form of the statements that open and close an ODS destination.
ods destination <options>;    /* opens the destination */
    /* procedure statements and other program elements here */
ods destination close;    /* closes the destination */
For example, to send output to the LISTING destination, you would specify the following:
ods listing;
    /* procedure statements and other program elements here */
ods listing close;
For more information about ODS destinations, see Managing ODS Destinations and ODS Destination Statement Options.

The LISTING Destination

The LISTING destination is somewhat different from the other ODS destinations. For the LISTING destination, if you do not specify a SAS/GRAPH device, then your output is sent to the GRAPH window. However, if you specify a device, then the device determines where your output is sent in addition to determining the graphics format. For example, the PNG device sends output to a PNG file instead of the GRAPH window. Your company might have device drivers specific to your site that send output directly to a certain printer. Where your output is sent is controlled by the device entry in the SASHELP.DEVICES catalog. For more information about devices, see Controlling the Graphics Output Format with the DEVICE= Option and Using Graphics Devices.
The LISTING destination is not open by default. You must open the LISTING destination at the beginning of your SAS program if you want to send output to it. You should close the LISTING destination at the end of your program to conserve resources. See Closing Destinations to Save System Resources for more information.
The LISTING destination does not have to be closed before output can be generated.

Introduction to Styles

By default, ODS applies a style to all output. A style is a template, or set of instructions, that determines the colors, font face, font sizes, and other presentation aspects of your output. SAS ships many predefined styles in the STYLES item store, such as Analysis, Statistical, and Journal. Examples of some of these predefined styles are shown in Examples of Styles Available in SASHELP.TMPLMST. Many additional styles (see Viewing the List of Styles Provided by SAS) are available in the STYLES item store in SASHELP.TMPLMST.
Each destination has a default style associated with it. For example, the default style for the PDF destination is Printer, and the default style for the HTML destination is HTMLBlue. See ODS Destinations and Default Styles and Recommended Styles for more information.
Examples of Styles Available in SASHELP.TMPLMST
Style=Statistical
Example of Style=Statistical
Style=Analysis
Example of Style=Analysis
Style=Ocean
Example of Style=Ocean
Style=Journal
Example of Style=Journal

Specifying a Style

To change the style that is applied to your output, specify the STYLE= option on your ODS destination statement. For example, suppose you want to change the overall look of your graph for the HTML destination to the Analysis style. Do this by specifying style=analysis in the ODS HTML destination statement as follows:
ods html style=analysis;
See About Style Templates and Specifying a Style for more information.
Note: You can turn off the use of styles by default by specifying the NOGSTYLE option. See Changing the Appearance of Output to Match That of Earlier SAS Releases and the GSTYLE System Option for more information.