Previous Page | Next Page

Dictionary of ODS Language Statements

ODS EXCLUDE Statement



Specifies output objects to exclude from ODS destinations.
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;


Required Arguments

exclusion(s)

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)>
output-object

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:

  • 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
    the partial paths are:
    City_Pop_90.TestsForLocation
    TestsForLocation
  • a label that is enclosed by quotation marks.

    For example,

    "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.  [cautionend]

  • 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"
  • 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 .

See also: ODS TRACE Statement.
(PERSIST)

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:

  • any ODS SELECT statement

  • ODS EXCLUDE NONE

  • ODS EXCLUDE ALL

  • an ODS EXCLUDE statement that applies to the same output object but does not specify PERSIST

This action is true even if the DATA or procedure step ends.
Requirement: You must enclose PERSIST in parentheses.
ALL

specifies that ODS does not send any output objects to the open destination.

Alias: ODS EXCLUDE DEFAULT
Interaction: If you specify ALL without specifying a destination, ODS sets the overall list to EXCLUDE ALL and sets all other lists to their defaults.
Tip: Using ODS EXCLUDE ALL is different from closing a destination. The destination remains open, but no output objects are sent to it.
Tip: To temporarily suspend a destination, use ODS SELECT NONE. Use ODS SELECT ALL when you want to resume sending output to the suspended destination.
NONE

specifies that ODS send all of the output objects to the open destination.

Interaction: If you specify the NONE argument without specifying a destination, ODS sets the overall list to EXCLUDE NONE and sets all other lists to their defaults.
Tip: ODS EXCLUDE NONE has the same effect as ODS SELECT ALL.
Tip: To temporarily suspend a destination, use ODS SELECT NONE. Use ODS SELECT ALL when you want to resume sending output to the suspended destination.

Options

NOWARN

suppresses the warning that an output object was requested but not created.

ODS-destination

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.
WHERE=where-expression

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');

where-expression

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>)
subsetting-variable

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:

_LABEL_

is the label of the output object.

_LABELPATH_

is the label path of the output object.

_NAME_

is the name of the output object.

_PATH_

is the full or partial path of the output object.

operator

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:

Examples of 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


Example 1: Conditionally Excluding Output Objects and Sending Them to Different Output Destinations

ODS features:

ODS EXCLUDE statement:

ODS-destination option

WHERE= option

ODS HTML statement:

CONTENTS=

FRAME=

PAGE=

TEXT=

ODS PDF statement:

TEXT=

STARTPAGE=

Other SAS features:

PROC UNIVARIATE


Program

 Note about code
options nodate;  
   data BPressure;
      length PatientID $2;
      input PatientID $ Systolic Diastolic @@;
      datalines;
   CK 120 50  SS 96  60 FR 100 70
   CP 120 75  BL 140 90 ES 120 70
   CP 165 110 JI 110 40 MC 119 66
   FC 125 76  RW 133 60 KD 108 54
   DS 110 50  JW 130 80 BH 120 65
   JW 134 80  SB 118 76 NS 122 78
   GS 122 70  AB 122 78 EC 112 62
   HH 122 82
   ;
   run;
 Note about code
  ods html text='Systolic Blood Pressure' file='Systolic-body.html' 
           frame='Systolic-frame.htm'
           contents='Systolic-contents.htm'
           page='Systolic-page.htm';
 Note about code
ods pdf file='Diastolic.pdf' text='Diastolic Blood Pressure' startpage=no;
   
 Note about code
ods html exclude where=(_path_ ? "Diastolic" ) ;
ods pdf exclude where=(_path_ ? "Systolic" ) ;
 Note about code
   proc univariate data=BPressure;
      var Systolic Diastolic;
   run;
 Note about code
ods html close;

Partial HTML Output

HTML Output with Systolic Output Objects

[HTML Output with Systolic Output Objects]


Partial PDF Output

PDF Output with Diastolic Output Objects

[PDF Output with Diastolic Output Objects]


See Also

Statements:

ODS SELECT Statement

ODS SHOW Statement

ODS TRACE Statement

Previous Page | Next Page | Top of Page