Dictionary of ODS Language Statements |
Valid: | anywhere |
Category: | ODS: Output Control |
Syntax | |
Required Arguments | |
Options | |
Details | |
Example | |
Conditionally Excluding Output Objects and Sending Them to Different Output Destinations | |
See Also |
Syntax |
ODS <ODS-destination> EXCLUDE exclusion(s)| ALL | NONE; |
specifies one or more output objects to add to an exclusion list.
By default, ODS automatically modifies exclusion lists at the end of a DATA step that uses ODS, or at the end of a procedure step. For information about modifying these lists, see Selection and Exclusion Lists.
Each exclusion has the following form:
output-object <(PERSIST)> |
specifies one or more output objects to exclude. 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. You can specify an output object in any of the following ways:
Univariate.City_Pop_90.TestsForLocationis 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.TestsForLocationthe partial paths are:
City_Pop_90.TestsForLocation TestsForLocation
a label that is enclosed by quotation marks.
"The UNIVARIATE Procedure"
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"the partial label paths are:
"CityPop_90"."Tests For Location" "Tests For Location"
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 .
See also: | ODS TRACE Statement. |
keeps the output-object that precedes the PERSIST option in the exclusion list until you explicitly modify the list with any of the following ODS statements:
This action is true even if the DATA or procedure step ends.Requirement: | You must enclose PERSIST in parentheses. |
specifies that ODS does not send any output objects to the open destination.
specifies that ODS send all of the output objects to the open destination.
suppresses the warning that an output object was requested but not created.
specifies to which ODS destination's exclusion list to write, where ODS-destination can be any valid ODS destination. For a discussion of ODS destinations, see Understanding ODS Destinations.
Default: | If you omit ODS-destination, ODS writes to the overall exclusion list. |
Tip: | To set the exclusion list for the output destination to something other than the default, use the ODS OUTPUT Statement. |
excludes output objects that meet a particular condition. For example, the following statement excludes only output objects with the word "Histogram" in their name:
ods exclude where=(_name_ ? 'Histogram');
is an arithmetic or logical expression that consists of a sequence of operators and operands. where-expression has this form:
(subsetting-variable <comparison-operator where-expression-n>) |
is a special kind of WHERE expression operand used by SAS to help you find common values in items. For example, this EXCLUDE statement excludes only output objects with the path City_Pop_90.TestsForLocation :
ods exclude / where=(_path_ = 'City_Pop_90.TestsForLocation' );
subsetting-variable is one of the following:
is the label of the output object.
is the label path of the output object.
is the name of the output object.
is the full or partial path of the output object.
compares a variable with a value or with another variable. operator can be AND, OR NOT, OR, AND NOT, or a comparison operator.
The following table lists some comparison operators:
Symbol | Mnemonic Equivalent | Definition |
---|---|---|
= | EQ | Equal to |
^= or ~= or ¬= or <> | NE | Not equal to |
> | GT | Greater than |
< | LT | Less than |
>= | GE | Greater than or equal to |
<= | LE | Less than or equal to |
|
IN | Equal to one from a list of values |
Details |
You can maintain a selection list for one destination and an exclusion list for another. However, the results are less complicated if you maintain the same types of lists for all the destinations to which you route output.
Example |
ODS EXCLUDE statement:
| |||||||||
ODS HTML statement:
| |||||||||
ODS PDF statement:
|
PROC UNIVARIATE |
ods html text='Systolic Blood Pressure' file='Systolic-body.html' frame='Systolic-frame.htm' contents='Systolic-contents.htm' page='Systolic-page.htm'; |
ods pdf file='Diastolic.pdf' text='Diastolic Blood Pressure' startpage=no; |
ods html exclude where=(_path_ ? "Diastolic" ) ; ods pdf exclude where=(_path_ ? "Systolic" ) ; |
proc univariate data=BPressure; var Systolic Diastolic; run; |
ods html close; |
HTML Output with Systolic Output Objects
PDF Output with Diastolic Output Objects
See Also |
|
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.