| Managing Your Graphics With ODS |
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:
opens the HTML destination
specifies that images be written to the file "C:\myfiles\images"
specifies that other output types be written to the file "C:\myfiles"
specifies an image resolution of 150
changes the style to Journal
ods html path="c:\myfiles" gpath="c:\myfiles" (url="http://www.sas.com/images/") image_dpi=150 style=journal;
You can 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 and style. For more information about this topic, see ODS Destination Statement Options.
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".
ods html body="barGraph.html" path="C:\myfiles\" style=journal; ... SAS statements ... ods html close;
The output is written to the file barGraph.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 line 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 on 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 file name 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.
These options are specified on ODS destination statements, using the following form:
| 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 on 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 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. |
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.