Chapter Contents

Previous

Next
IDXWHERE=

IDXWHERE=



Overrides the SAS System decision about whether to use an index to satisfy the conditions of a WHERE expression

Valid in: DATA step and PROC steps
Category: User Control of SAS Index Usage
Restriction: Use with input data sets only.
Restriction: Mutually exclusive with IDXNAME= data set option


Syntax
Syntax Description
Details
Comparisons
Examples
Example 1: Specifying Index Usage
Example 2: Specifying No Index Usage
See Also

Syntax

IDXWHERE=YES|NO

Syntax Description

YES
tells SAS to choose the best index to optimize a WHERE expression, and to disregard the possibility that a sequential search of the data set might be more resource-efficient.

NO
tells SAS to ignore all indexes and satisfy the conditions of a WHERE expression with a sequential search of the data set.

Note:   You cannot use IDXWHERE= to override the use of an index to process a BY statement.  [cautionend]


Details

By default, to satisfy the conditions of a WHERE expression for an indexed SAS data set, SAS decides whether to use an index or to read the data set sequentially. The software estimates the relative efficiency and chooses the method that is more efficient.

You might need to override the software's decision by specifying the IDXWHERE= data set option because the decision is based on general rules that may occasionally not produce the best results. That is, by specifying the IDXWHERE= data set option, you are able to determine the processing method.

Note:   The specification is not a permanent attribute of the data set and is valid only for the current use of the data set.  [cautionend]

Note:   If you issue the system option MSGLEVEL=I, you can request that IDXWHERE= usage be noted in the SAS log if the setting affects index processing.  [cautionend]


Comparisons

IDXNAME= enables you to direct SAS to use a specific index.


Examples

Example 1: Specifying Index Usage

This example uses the IDXWHERE= data set option to tell SAS to decide which index is the best to optimize the WHERE expression. SAS then disregards the possibility that a sequential search of the data set might be more resource-efficient:

data mydata.empnew;
   set mydata.employee (idxwhere=yes);
   where empnum < 2000;

Example 2: Specifying No Index Usage

This examples uses the IDXWHERE= data set option to tell SAS to ignore any index and to satisfy the conditions of the WHERE expression with a sequential search of the data set:

data mydata.empnew;
   set mydata.employee (idxwhere=no);
   where empnum < 2000;

See Also

Data Set Option:
IDXNAME=
"SAS Indexes" in the "SAS Data Files" section of SAS Language Reference: Concepts
"WHERE Processing" in SAS Language Reference: Concepts


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.