SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
SAS Output
By default, ODS output is formatted according to instructions that a PROC step or DATA step defines. However, ODS provides ways for you to customize the output. You can customize the output for an entire SAS job, or you can customize the output for a single output object.
Selection and Exclusion Lists
You can specify which output objects that you want to produce by selecting or excluding them in a list. For each ODS destination, ODS maintains either a selection list or an exclusion list. A selection list is a list of output objects that are sent to the destination. An exclusion list is a list of output objects that are excluded from the destination. ODS also maintains an overall selection list or an overall exclusion list. You can use these lists to control which output objects go to the specified ODS destinations.
To see the contents of the lists use the ODS SHOW statement. The lists are written to the SAS log. The following table shows the default lists:
ODS Destination | Default List |
---|---|
OUTPUT | EXCLUDE ALL |
All others | SELECT ALL |
How Does ODS Determine the Destinations for an Output Object?
To specify an output object, you need to know which 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. For more information, about the ODS TRACE statement see The Complete Guide to the SAS Output Delivery System . You can specify an output object as any of the following:
-
a full path. For example,
Univariate.City_Pop_90.TestsForLocation
is the full path of the output object.
-
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 example, if the full path is
Univariate.City_Pop_90.TestsForLocation
then the partial paths are:
City_Pop_90.TestsForLocation TestsForLocation
-
a label that is enclosed in quotation marks.
For example,
"Tests For Location"
-
a label path. For example, the label path for the output object is
"The UNIVARIATE Procedure". "CityPop_90"."Tests For Location"
Note The trace record shows the label path only if you specify the LABEL option in the ODS TRACE statement.
-
a partial label path. A partial label path consists of any part of the label that begins immediately after a period (.) and continues to the end of the label. For example, if the label path is
"The UNIVARIATE Procedure"."CityPop_90"."Tests For Location"
then the partial label paths are:
"CityPop_90"."Tests For Location" "Tests For Location"
-
a mixture of labels and paths.
-
any of the partial path specifications, followed by a pound sign (#) and a number. For example, TestsForLocation#3 refers to the third output object that is named TestsForLocation.
As each output object is produced, ODS uses the selection and exclusion lists to determine which destination or destinations the output object will be sent to. The following figure illustrates this process:
Note | Although you can maintain a selection list for one destination and an exclusion list for another, it is easier to understand the results if you maintain the same types of lists for all the destinations where you route output. |
Customized Output for an Output Object
For a procedure, the name of the table definition that is used for an output object comes from the procedure code. The DATA step uses a default table definition unless you specify an alternative with the TEMPLATE= suboption in the ODS option in the FILE statement. For more information, see the section on the TEMPLATE= suboption in the The Complete Guide to the SAS Output Delivery System .
To find out which table definitions a procedure or the DATA step uses for the output objects, you must look at a trace record. To produce a trace record in your SAS log, submit the following SAS statements:
ods trace on; your-proc-or-DATA-step ods trace off;
Remember that not all procedures use table definitions. If you produce a trace record for one of these procedures, no definition appears in the trace record. Conversely, some procedures use multiple table definitions to produce their output. If you produce a trace record for one of these procedures, more than one definition appears in the trace record.
The trace record refers to the table definition as a template. For a detailed explanation of the trace record, see the section on the ODS TRACE statement in the The Complete Guide to the SAS Output Delivery System .
You can use PROC TEMPLATE to modify an entire table definition. When a procedure or DATA step uses a table definition, it uses the elements that are defined or referenced in its table definition. In general, you cannot directly specify a table element for your procedure or DATA step to use without modifying the definition itself.
Note | Three Base SAS procedures, PROC PRINT, PROC REPORT and PROC TABULATE, do provide a way for you to access table elements from the procedure step itself. Accessing the table elements enables you to customize your report. For more information about these procedures, see the Base SAS Procedures Guide |