Previous Page | Next Page

Dictionary of ODS Language Statements

ODS TRACE Statement



Writes to the SAS log a record of each output object that is created, or suppresses the writing of this record.
Valid: anywhere
Category: ODS: Output Control
Default: OFF
Featured in: Creating a Data Set with and without The MATCH_ALL Option

Syntax
Required Arguments
Options
Details
Contents of the Trace Record
Specifying an Output Object
Example
Determining Which Output Objects a Procedure Creates
See Also

Syntax

ODS TRACE ON</option(s)>;
ODS TRACE OFF;


Required Arguments

OFF

turns off the writing of the trace record.

Alias: NO
ON

turns on the writing of the trace record.

Alias: OUTPUT
Alias: YES

Options

EXCLUDED

includes, in the trace record, information for excluded output objects.

Featured in: Conditionally Selecting Output Objects
LABEL

includes the label path for the output object in the record. You can use a label path anywhere that you can use a path.

Tip: This option is helpful for users who are running a localized version of SAS, because the labels are translated from English to the local language. The names and paths of output objects are not translated because they are part of the syntax of the Output Delivery System.
LISTING

writes the trace record to the Listing destination, so that each part of the trace record immediately precedes the output object that it describes.


Details


Contents of the Trace Record

ODS produces an output object by combining data from the data component with a table definition. The trace record provides information about the data component, the table definition, and the output object. By default, the record that the ODS TRACE statement produces contains these items:

Name

is the name of the output object. You can use the name to reference this output object and others with the same name. For details on how to reference an output object, see How ODS Determines the Destinations for an Output Object. For example, you could use this name in an ODS OUTPUT statement to make a data set from the output object, or you could use it in an ODS SELECT or an ODS EXCLUDE statement.

Tip: The name is the rightmost part of the path that appears in the trace record.
Label

briefly describes the contents of the output object. This label also identifies the output object in the Results window.

Data name

is the name of the data component that was used to create this output object. The data name appears only if it differs from the name of the output object.

Data label

describes the contents of the data.

Template

is the name of the table definition that ODS uses to format the output object. You can modify this definition with PROC TEMPLATE. See the EDIT Statement for more information.

Path

is the path of the output object. You can use the path to reference this output object. For example, you could use the path in the ODS OUTPUT statement to make a data set from the output, or you could use it in an ODS SELECT or an ODS EXCLUDE statement.

The LABEL option modifies the trace record by including the label path for the object in the record. See the discussion of the LABEL option.


Specifying an Output Object

After you have determined which output objects your SAS program produces, you can specify the output objects in statements such as ODS EXCLUDE, ODS SELECT, and so on. You can specify an output object by using one of the following:


Example


Example 1: Determining Which Output Objects a Procedure Creates

ODS features:

ODS TRACE statement:

LABEL

OFF

ON

Other SAS features:

PROC UNIVARIATE

Data set:

StatePop.

This example shows how to determine the names and labels of the output objects that a procedure creates. You can use this information to select and exclude output objects.

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


Program

 Note about code
ods trace on / label;
 Note about code
proc univariate data=statepop mu0=3.5;
   var citypop_90 citypop_80;
run;
 Note about code
ods trace off;

SAS Log

 Note about figure
Output Added:
-------------
Name:       Moments
Label:      Moments
Template:   base.univariate.Moments
Path:       Univariate.CityPop_90.Moments
Label Path: "The Univariate Procedure"."CityPop_90"."Moments"
-------------

Output Added:
-------------
Name:       BasicMeasures
Label:      Basic Measures of Location and Variability
Template:   base.univariate.Measures
Path:       Univariate.CityPop_90.BasicMeasures
Label Path: "The Univariate Procedure"."CityPop_90"."Basic Measures of Location and Variability"
-------------

Output Added:
-------------
Name:       TestsForLocation
Label:      Tests For Location
Template:   base.univariate.Location
Path:       Univariate.CityPop_90.TestsForLocation
Label Path: "The Univariate Procedure"."CityPop_90"."Tests For Location"
-------------

Output Added:
-------------
Name:       Quantiles
Label:      Quantiles
Template:   base.univariate.Quantiles
Path:       Univariate.CityPop_90.Quantiles
Label Path: "The Univariate Procedure"."CityPop_90"."Quantiles"
-------------
Output Added:
-------------
Name:       ExtremeObs
Label:      Extreme Observations
Template:   base.univariate.ExtObs
Path:       Univariate.CityPop_90.ExtremeObs
Label Path: "The Univariate Procedure"."CityPop_90"."Extreme Observations"
-------------
Output Added:
-------------
Name:       Moments
Label:      Moments
Template:   base.univariate.Moments
Path:       Univariate.CityPop_80.Moments
Label Path: "The Univariate Procedure"."CityPop_80"."Moments"
-------------

Output Added:
-------------
Name:       BasicMeasures
Label:      Basic Measures of Location and Variability
Template:   base.univariate.Measures
Path:       Univariate.CityPop_80.BasicMeasures
Label Path: "The Univariate Procedure"."CityPop_80"."Basic Measures of Location and Variability"
-------------

Output Added:
-------------
Name:       TestsForLocation
Label:      Tests For Location
Template:   base.univariate.Location
Path:       Univariate.CityPop_80.TestsForLocation
Label Path: "The Univariate Procedure"."CityPop_80"."Tests For Location"
-------------

Output Added:
-------------
Name:       Quantiles
Label:      Quantiles
Template:   base.univariate.Quantiles
Path:       Univariate.CityPop_80.Quantiles
Label Path: "The Univariate Procedure"."CityPop_80"."Quantiles"
-------------

Output Added:
-------------
Name:       ExtremeObs
Label:      Extreme Observations
Template:   base.univariate.ExtObs
Path:       Univariate.CityPop_80.ExtremeObs
Label Path: "The Univariate Procedure"."CityPop_80"."Extreme Observations"
-------------

See Also

Statements:

ODS EXCLUDE Statement

ODS SELECT Statement

Previous Page | Next Page | Top of Page