Statistical Graphics Using ODS


ODS Destination Statements

ODS has a number of statements that control the destination of ODS output. The ODS destination statements that are most commonly used in ODS Graphics are ODS DOCUMENT, ODS HTML, ODS LISTING, ODS PCL, ODS PDF, ODS PS, and ODS RTF. Specifying a statement opens a destination, unless the CLOSE option is specified. Each of the following statements opens an ODS destination:

ods html;
ods rtf;
ods html image_dpi=300;
ods listing style=HTMLBlue;

Each of the following statements closes an ODS destination:

ods html close;
ods rtf close;
ods listing close;

The following statement closes all open destinations:

ods _all_ close;

The following two options are commonly used in ODS destination statements to control aspects of ODS Graphics:

IMAGE_DPI=dpi

specifies the image resolution of graphical output, measured in number of dots per inch (DPI). The default varies depending on the destination. For example, the default is 96 for HTML and 200 for RTF.

STYLE=style-name

specifies the output style. Commonly used styles include HTMLBLUE, HTMLBLUECML, PEARL, PEARLJ, SAPPHIRE, DEFAULT, LISTING, STATISTICAL, JOURNAL, JOURNAL2, JOURNAL3, RTF, and ANALYSIS.

Other options provide ways to control the files that you create. For example, the following statement opens the HTML destination:

ods html body='b.html' contents='c.html' frame='a.html';

This statement also writes the body of the output to the file b.html, the table of contents to the file c.html, and an overall frame that contains both the contents and the output to the file a.html. Alternatively, you can specify FILE= instead of BODY=.

If you are using a destination for which individual graphs are created (for example, LISTING or HTML), you can use the GPATH= option to specify the directory where your graphics files are saved, as in the following example:

ods html gpath="C:\figures";

For more information about individual image files and options specified in the ODS destination statements, see the sections Image File Types, Saving Graphic Image Files, LISTING Destination, and HTML Destination. For complete information about the ODS destination statements, see the SAS Output Delivery System: User's Guide.