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:
  • opens the HTML destination
  • specifies that images be written to the directory C:\myfiles\images
  • specifies that the path to the images is specified as http://www.sas.com/images/image-filename in the HTML file
  • specifies that other output files (for example, the HTML file) be written to the directory C:\myfiles\
  • specifies that the name of the initial HTML file that is displayed is barGraph.htm
  • changes the style to Analysis.
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 default folder is the WORK folder. 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 WORK folder. You can check the SAS log to verify the name of the file in which your output is saved.
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 WORK directory. For complete documentation on PATH= option, see the ODS MARKUP or TAGSET.RTF statements in SAS Output Delivery System: User's Guide.
IMAGE_DPI=
specifies the image resolution in DPI for the output images sent to HTML, LISTING, or RTF destinations. The default value is 96. For complete documentation on the IMAGE_DPI= option, see the statement documentation 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 about using the STYLE= option with SAS/GRAPH output, see Using ODS Styles, Device Parameters, and Options.
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.