Using the Output Delivery System

Setting the Destination in ODS Statements

You can use ODS destination statements to explicitly set destinations. These statements are described in this chapter and in detail in the SAS Output Delivery System: User's Guide. When you open a new destination, you should close all other open destinations unless you really need multiple destinations to be open. When multiple destinations are open, each piece of output is created multiple times, once per destination. Closing unneeded destinations increases efficiency.

You can create HTML output in any environment by using the ODS HTML statement as in the following example:

ods _all_ close;
ods html file='MyFile.html';

proc reg data=sashelp.class;
   model height=weight;
run; quit;

ods html close;
ods listing;

The first statement closes all open destinations. The second statement opens the HTML destination and specifies the HTML output file MyFile.html. The last two statements close the HTML destination and open the LISTING destination for subsequent output.

You can create LISTING output in any environment by using the ODS LISTING statement as in the following example:

ods _all_ close;
ods listing;

proc reg data=sashelp.class;
   model height=weight;
run; quit;

The first statement closes all open destinations. The second statement opens the LISTING destination which sends output to the SAS listing. In this example, the LISTING destination is not closed so that subsequent steps can append more information to the listing.

If the LISTING destination is open, then you can simultaneously create LISTING and HTML output as follows:

* The ODS LISTING destination is not closed,
  which is not recommended for efficiency reasons;

ods html file='Reg.htm';

proc reg data=sashelp.class;
   model height=weight;
run; quit;

ods html close;

Sometimes you see ODS Graphics notes or warnings multiple times when multiple destinations are open. The messages appear once for each affected graph for each destination.