Chapter Contents |
Previous |
Next |
The ODS Statements |
Featured in: | Creating Output Data Sets |
ODS OUTPUT action; |
ODS OUTPUT data-set-definition(s); |
To do this ... | Use this action | |
---|---|---|
Set the list for the Output destination to EXCLUDE ALL | CLEAR | |
Close the Output destination | CLOSE | |
Write to the SAS log the current selection or exclusion list for the Output destination | SHOW |
Actions |
Restriction: | The Output destination must be open for this action to take effect. |
Required Arguments |
If you do not specify an action, you must specify a data-set-definition.
output-object-specification<=SAS-data-set> |
output-object<(MATCH_ALL<=macro-var-name> PERSIST=PROC | RUN)> |
To specify an output object, you need to know what output objects your SAS program produces. The ODS TRACE statement writes to the SAS log a trace record that includes the path, the label, and other information about each output object that is produced. (See ODS TRACE Statement.) You can specify an output object as
Univariate.City_Pop_90.TestsForLocationpartial paths are
City_Pop_90.TestsForLocation
TestsForLocation
"The UNIVARIATE Procedure"."CityPop_90" ."Tests For Location"partial label paths are
"CityPop_90"."Tests For Location"
"Tests For Location"
By default, the ODS OUTPUT statement tries to put all output objects that have the same output-path into one SAS data set. Sometimes this process is problematic because the structure of the output object changes after the data set has been opened. For instance, some data-dependent output objects may have a different number of columns than other output objects identified by the same output-path. In this case, the columns that are in the first output object will determine the variables that are in the data set. Two difficulties may arise:
If the ODS OUTPUT statement has a problem putting all output objects into one data set, it returns a warning.
Tip: | To create multiple data sets from the same output object, list the output object as many times as you wish. Each time that you list the output object, specify a different data set. |
Featured in: | Creating Output Data Sets |
If you specify macro-var-name, the system stores a list of all the data sets that it creates in the macro variable that you specify. Thus, if you want to concatenate all the data sets after the PROC step, you can use the macro variable to specify all the data sets in a DATA step.
Featured in: | Creating Output Data Sets |
ods output clear;
Restriction: | Only effective when MATCH_ALL is in effect (and you are, therefore, creating a data set for each output object). |
Featured in: | Creating Data Sets from Similar Output Objects from Different Procedures |
See also: | How ODS Determines the Destinations for an Output Object |
If you are creating a single data set, the ODS OUTPUT
statement simply uses the name that you specify. If you are creating multiple
data sets with MATCH_ALL, the ODS OUTPUT statement appends digits to the name.
For example, if you specify test
as SAS-data-set and you create three data sets, ODS names the
first data set test
. The additional data sets
are named test1
and test2
.
Note: If you end the file name with a digit, ODS begins incrementing
with that digit. For example, if you specify may5
as SAS-data-set and you create three data sets,
ODS names the first data set may5
. The additional
data sets are named may6
and may7
.
Default: | If you do not specify a data set, ODS names the output data set DATAn, where n is the smallest integer that makes the name unique. |
Tip: | You can specify data set options in parentheses immediately after SAS-data-set. |
Featured in: | Creating Output Data Sets |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.