Previous Page | Next Page

Using the Output Delivery System

Output Objects and ODS Destinations

All SAS procedures produce output objects that ODS delivers to various ODS destinations, according to the default specifications for the procedure or according to your own specifications. Typically, you see the output objects displayed as tables, data sets, or graphs. Underlying all output (for example, a table of parameter estimates) are two component parts:

  • the data component, which consists of the results computed by a SAS procedure

  • the template, which contains the instructions for formatting and displaying the results

You define the form that the output should take when you specify an ODS destination. Some supported destinations are as follows:

  • LISTING destination (the standard SAS listing), which is open by default

  • HTML destination, for viewing in a browser

  • RTF, for inclusion in Microsoft Word

  • PDF, PostScript, and PCL, for high-fidelity printers

  • OUTPUT destination, for saving results to SAS data sets

  • DOCUMENT destination, for saving, modifying and replaying your output

You can open multiple ODS destinations at the same time so that a single procedure step can produce output for multiple destinations. If you do not supply any ODS statements, ODS delivers all output to the LISTING destination. You can specify an output style for each ODS destination. The style controls the foreground, background, colors, lines, fonts, and so on.

Each output object has an associated template, provided by SAS, that defines its presentation format. You can use the TEMPLATE procedure to view or alter these templates or to create new templates, changing the headers, formats, column order, and so on. For more information, see the chapter titled "The Template Procedure" in the SAS Output Delivery System: User's Guide.

The following statements provide an example of temporarily closing the LISTING destination and making an output data set, Parm, from the parameter estimates table from PROC REG. Closing the LISTING destination is not required, but it is done frequently in the examples in this chapter for efficiency. Closing the LISTING suppresses the generation of output that is not needed or used. This is particularly beneficial with graphics. This example uses the SASHELP.Class data set, one of the sample data sets in the SASHELP library that are automatically available for your use. The following statements produce Figure 20.1:

   title 'Getting Started with ODS';
   
   ods listing close;
   
   proc reg data=sashelp.class;
      model height=weight;
      ods output ParameterEstimates=parms;
   run;
   
   ods listing;
   
   proc print noobs data=parms;
   run;
   

Figure 20.1 PROC REG Parameter Estimates Table
Getting Started with ODS

Model Dependent Variable DF Estimate StdErr tValue Probt
MODEL1 Height Intercept 1 42.57014 2.67989 15.89 <.0001
MODEL1 Height Weight 1 0.19761 0.02616 7.55 <.0001

The ODS OUTPUT statement contains a table name, an equal sign, and the name of the output SAS data set to create. The table names can be found using the ODS TRACE statement, which is described in the next section. Also see Example 20.4 for more information.

Previous Page | Next Page | Top of Page