Previous Page | Next Page

Managing Your Graphics With ODS

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 different 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\images" (url="http://www.sas.com/images/")
         body="barGraph.htm"
         style=analysis;

The following ODS HTML statement specifies that the output is sent to the HTML destination. Because it does not specify either the PATH= or GPATH= options, all output is sent to the default SAS folder.

ods html body="barGraph.html";

The HTML output is written to the file specified by the BODY= option, barGraph.html. 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.

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.

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

Options that you might want to specify on ODS destination statements are the following:

GPATH= location (URL= 'Uniform-Resource-Locator' | NONE)

specifies the location for all graphics output that is generated while the destination is open. You can specify an external file or a fileref. You can use the URL= suboption to specify a URL that is used in links and references to output files. 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= location (URL= 'Uniform-Resource-Locator' | NONE)

specifies the location of an external file or a SAS catalog for all markup files. You can specify an external file or a fileref. You can use the URL= suboption to specify a URL that is used in links and references to output files. 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.

DPI=

specifies the image resolution in DPI for the output images sent to PRINTER family destinations. The default value for the PRINTER destination is 150. For complete documentation on the DPI= option, see the valid ODS PRINTER statement in SAS Output Delivery System: User's Guide.

STYLE= style-definition

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 on the STYLE= option, see the ODS statements in SAS Output Delivery System: User's Guide. For more information on using the STYLE= option with SAS/GRAPH output, see Controlling The Appearance of Your Graphs.

Note:   If you specify the PATH= or GPATH= options, the directory name that you specify is used to refer to images that are generated as part of your output. For example, if you are sending output to the HTML destination, and you specify path="C:\myfiles\", then all HTML image tags use that path to refer to your images:

<img src="C:\myfiles\myoutput.png">

If your browser implements strict security regarding access to local files, you might have problems viewing the images. You can avoid these problems by specifying the URL= suboption.  [cautionend]

Previous Page | Next Page | Top of Page