Chapter Contents


The Complete Guide to the SAS Output Delivery System

Selecting Output Objects to Send to ODS Destinations

Some procedures, such as PROC UNIVARIATE, produce multiple output objects. Any procedure that uses ODS produces multiple output objects when you use BY-group processing. ODS enables you to select which of these output objects go to the open ODS destinations. ODS destinations include the Listing destination, the HTML destination, the Printer destination, and the Output destination. For more information on ODS destinations, see ODS Destinations.

You choose the objects to send to destinations with the ODS SELECT or the ODS EXCLUDE statement. To select individual output objects, use this form of the ODS SELECT statement:

ODS SELECT selection(s);
where each selection can be a full path, a name, or a label (see the trace record in SAS Log Produced by the ODS TRACE Statement). You can also use a partial path. A partial path consists of any part of the full path that begins immediately after a period (.) and continues to the end of the full path. For details on referencing output objects, see How to Specify an Output Object.

For example, to select just the output objects that contain the basic measures and the quantiles from the PROC UNIVARIATE output, use the following program.

Note:   This example uses file names that may not be valid in all operating environments. To successfully run the example in your operating environment, you may need to change the file specifications. See Alternative ODS HTML Statements for Running Examples in Different Operating Environments.  [cautionend]

/* Create HTML files. */
ods html body='select-body.htm'
/* Select output objects by name. */
ods select BasicMeasures Quantiles;

/* Analyze the data.      */
proc univariate data=statepop mu0=3.5;
   var citypop_90 noncitypop_90;

/* Close the HTML destination. */
ods html close;

The frame file appears in Frame File for Selected Output Objects. The program also creates Listing output, which is not shown. The Listing output contains the same information as the HTML body file, but it is formatted with the traditional SAS monospace font.

Frame File for Selected Output Objects
The contents file shows that for each variable in the analysis, PROC UNIVARIATE produces two output objects: one that contains basic measures and one that contains quantiles. All four output objects are in the body file because the ODS SELECT statement used names to identify the objects. If the ODS SELECT statement had used paths, which are unique, it could have selected output objects for the individual variables. [HTML Output]

For more information on selecting output objects, see ODS SELECT Statement.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.