Getting Started With SAS/GRAPH |
ODS destinations determine where your SAS/GRAPH output is sent. For example, the LISTING destination sends output to the GRAPH window (by default), and the HTML destination sends output to an HTML file. 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 LISTING (the GRAPH window, by default), HTML, RTF, and PDF, but other destinations are also available.
To generate output from SAS, a valid ODS destination must be open. By default, the LISTING destination is open, but you can open other destinations as needed by specifying an ODS destination statement. Depending on the options available for the destination, you can specify options such as the filename or the path to an output directory. With the exception of the LISTING destination, you must also close the destination before output is generated.
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 HTML destination, you would specify
ods html; /* procedure statements and other program elements here */ ods html close;
For more information on ODS destinations, see Managing ODS Destinations and ODS Destination Statement Options.
The LISTING Destination |
The LISTING destination is open by default. If you are sending output to other destinations and are not interested in the output that is sent to the LISTING destination, you should close it to conserve resources. The usual practice is to close LISTING at the beginning of your program and to reopen it at the end. This practice ensures that you always have one open destination. See Closing Destinations To Save System Resources for more information.
The LISTING destination is somewhat different from other ODS destinations. For the LISTING destination, if you do not specify a device, then your output is sent to the GRAPH window. However, if you specify a device, then where your output is sent is determined by the device. 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. See Controlling the Graphics Output Format With the DEVICE= Option and Using Graphics Devices for more information about devices.
The LISTING destination is the only destination that 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 Default. See ODS Destinations and Default Styles and Recommended Styles for more information.
Style=Statistical |
Style=Analysis |
Style=Ocean |
Style=Harvest |
Style=Gears |
Style=Banker |
Specifying a Style |
To change the style that is applied to your output, specify the STYLE= option on your ODS destination statement. For example, if you want to change the overall look of your graph for the HTML destination to the Analysis style, you would specify 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 in SAS Language Reference: Dictionary for more information.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.