Sending Output to Multiple Open Destinations

Tips for Sending Output to Multiple Destinations

When you are sending output to more than one destination at the same time, you should remember two points:
  • You should close any open destinations whose output you are not interested in. Doing so saves system resources.
  • If you specify a device that is not supported for an open destination, SAS/GRAPH switches to the default device for that destination and prints a warning to the SAS log.

Closing Destinations to Save System Resources

SAS/GRAPH creates output for every open destination. The HTML destination is open by default, and you can open as many additional destinations as needed. For example, you can open the LISTING and PDF destinations, and generate output for all three destinations by submitting your SAS code only once. However, SAS/GRAPH goes through the process of generating GRSEG catalog entries and graphics output files for each open destination. This process uses system resources. Each open destination increases system resources required by your application. If you are not interested in the output of a destination, it is recommended that you close that destination.

Specifying Devices and Styles with Multiple Open Destinations

Unless you specify a different device or different style, SAS/GRAPH uses the default device and default style for each open destination.
For example, suppose your SAS program specifies the following:
ods rtf;
      /* procedure statements and other program elements here */
ods rtf close;
SAS/GRAPH uses the PNG device and the HTMLBlue style to generate output for the HTML destination (which is open by default). It also uses the SASEMF device and the RTF style to generate output for the RTF destination.
If you specify a different device with the DEVICE= option in the GOPTIONS statement, SAS/GRAPH attempts to use that device to generate output for every open destination. If you want to use a different style for all output, you need to specify that style on each ODS destination statement. For example, suppose you want to use the ACTIVEX device and the ANALYSIS style for all output sent to both the HTML and RTF destinations. In this case you would specify the GOPTIONS statement and the STYLE= option as follows:
goptions device=activex;
ods html style=analysis;
ods rtf style=analysis;
      /* procedure statements and other program elements here */
ods rtf close;
If you specify a device that is not supported for an open destination, SAS/GRAPH switches to the default device for that destination and prints a warning to the SAS log.