Previous Page | Next Page

Managing Your Graphics With ODS

Specifying a Destination


Overview

For creation of these graphs, a valid ODS destination must be active. By default, the Listing destination is active. You can use an ODS destination statement, such as ODS HTML, to specify where you want your output to be displayed and where you want your image files to be stored. You can also specify some appearance options for the graphics output such as image DPI, width, height, and style. For more information about this topic, see Using the ODS GRAPHICS Statement.

The following ODS HTML statement specifies that the Journal style is used, the output is sent to the HTML destination, and images are stored in the folder "C:\myfiles\images". For the complete program, see Controlling Graphics with the ODS GRAPHICS Statement.

ods html file="BoxPlot-Body.html"
 gpath=
"C:\myfiles\images" style=journal; ... SAS statements ... ods html close;

The output is written to the file BoxPlot-Body.html, which is saved in the SAS current folder. At start up, the SAS current folder is the same directory in which you start your SAS session. If you are running SAS with the windowing environment in the Windows operating system, then the current folder is displayed in the status bar at the bottom of the main SAS window. Images created by the output are stored in the folder "C:\myfiles\images". The STYLE= option changes the style from Default.Styles to Journal.Styles. For more information about changing the appearance of your graphics, see Controlling The Appearance of Your Graphs. The ODS HTML CLOSE statement closes the HTML destination, which enables you to see your output.

If you do not specify a filename for your output, then SAS provides a default file that is determined by the ODS destination. This file is saved in the SAS current folder. You can check the SAS log to verify the name of the file in which your output is saved.

The following table lists the ODS destinations and the type of output that results from each destination.

Relevant Destination Table
Destinations Results Default Style Default ImgFmt Default DPI
DOCUMENT ODS document (not applicable) (not applicable) (not applicable)
LISTING (table note 1) SAS output listing Listing PNG 100
OUTPUT SAS data set (not applicable) (not applicable) (not applicable)
HTML HTML file for online viewing Default PNG 100
LATEX  (table note 2) LaTeX file Default PostScript 200
PRINTER printable output in one of three different formats: PCL, PDF, or PS (PostScript) Printer for PDF and PS, monochromePrinter for PCL Embedded PNG 150
RTF output written in Rich Text Format for use with Microsoft Word 2000 RTF Embedded PNG 200
Measured RTF
RTF Embedded 200

TABLE NOTE 1:  Beginning with SAS 9.2, the ODS LISTING destination allows the use of ODS Graphics Editor. See the SAS/GRAPH: ODS Graphics Editor User's Guide for more information. [arrow]

TABLE NOTE 2:  LATEX is an experimental tagset. Do not use this tagset in production jobs.  [arrow]

Graphs rendered to the Listing destination are not automatically displayed in the output window or in the Graph window. To view these graphs go to the Results window and select the desired graph to view.

For complete documentation on ODS destinations, see SAS Output Delivery System: User's Guide.


ODS Destination Statement Options

There are several destination statement options that you can use to control where your files or graphics should be written, as well as specifying a new style, and specifying the appropriate image resolution in DPI for your output images. For example, the following ODS HTML statement:

ods html path="c:\myfiles"
         gpath="c:\myfiles" (url="images/")
         image_dpi=150
         style=journal;

These options are specified on ODS destination statements, using the following form:

ODS destination <option(s);>
GPATH= option

specifies the location for all graphics output that is generated while the destination is open. You can specify an external file, a fileref, or use the URL= suboption to specify a URL. The GPATH= option is valid for the Listing destination and the Markup family of destinations. If the GPATH option is not specified, the images are written to the location specified by the PATH option. For complete documentation on GPATH= option, see the ODS LISTING statement and the ODS MARKUP statement in SAS Output Delivery System: User's Guide.

PATH= option

specifies the location of an external file or a SAS catalog for all markup files. You can specify an external file, a fileref, or use the URL= suboption to specify a URL. The PATH= option is valid for the RTF, Measured RTF, and Markup family of destinations. If the PATH option is not specified, images are written to the current working directory. For complete documentation on PATH= option, see the ODS LISTING statement, ODS MARKUP statement, or TAGSET.RTF statement in SAS Output Delivery System: User's Guide.

IMAGE_DPI= | DPI= options

specifies the image resolution in DPI for the output images. Each ODS destination has a default DPI that is appropriate for output format. If a DPI is specified, then the image is scaled linearly from a baseline DPI of 100. The IMAGE_DPI= option is valid for the Listing, RTF, Markup family, and Measured RTF destinations. The DPI= option is valid for Printer family destinations. For complete documentation for the IMAGE_DPI= option, see the valid ODS destination statement in SAS Output Delivery System: User's Guide.

STYLE= option

specifies a style to be used for the output. Each ODS destination has a default style for the formatting of output. The style specifies a collection of visual attributes that are used for the rendering of the output. The STYLE= option is valid for all ODS destinations except the Document destination and the Output destination. For complete documentation for the STYLE= option, see the ODS statements in SAS Output Delivery System: User's Guide. For more information about using the STYLE= option with GTL based graphics, see Controlling The Appearance of Your Graphs.

Previous Page | Next Page | Top of Page