Statistical Graphics Using ODS |
Creating Graphs in Multiple Destinations |
This section illustrates how to send your output to more than one destination with a single execution of your SAS statements. For example, to create the default LISTING output and also both HTML and RTF output, you can specify the ODS HTML and the ODS RTF statements before your procedure statements.
ods html; ods rtf; . . . ods _all_ close;
The ODS _ALL_ CLOSE statement closes all open destinations.
You can also specify multiple instances of the same destination. For example, using the data in the section Contour and Surface Plots with PROC KDE, the following statements save the contour plot to the file contour.pdf and the surface plot to the file surface.pdf:
ods pdf file="contour.pdf"; ods pdf select ContourPlot; ods pdf(id=srf) file="surface.pdf"; ods pdf(id=srf) select SurfacePlot; ods graphics on; proc kde data=bivnormal; ods select ContourPlot SurfacePlot; bivar x y / plots=contour surface; run; ods _all_ close;
The ID= option assigns the name srf to the second instance of the PDF destination. Without the ID= option, the second ODS PDF statement closes the destination that was opened by the previous ODS PDF statement, and it opens a new instance of the PDF destination. In that case, the file contour.pdf is not created. For more information, see the ODS PDF statement in the SAS Output Delivery System: User's Guide.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.