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 with 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 dots per inch (DPI), which is the image resolution for graphical output. 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, SAPPHIRE, DEFAULT, LISTING, STATISTICAL, JOURNAL, JOURNAL2, JOURNAL3, RTF, and ANALYSIS.

Other options provide you with ways to control the files that are created. 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";

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