Chapter Contents

Previous

Next
IDXNAME=

IDXNAME=



Directs SAS to use a specific 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 IDXWHERE= data set option


Syntax
Syntax Description
Details
Comparisons
Examples
Example 1: Using a Specific Index
See Also

Syntax

IDXNAME=index-name

Syntax Description

index-name
specifies the name (up to 32 characters) of a simple or composite index for the SAS data set. SAS does not attempt to determine if the specified index is the best one or if a sequential search might be more resource-efficient.


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 read the data set sequentially. The software estimates the relative efficiency and chooses the method that is more efficient.

You might need to direct the software to use a specific index by specifying the IDXNAME= data set option because the decision is based on general rules that may occasionally not produce the best results. That is, by specifying the index, you are able to control which index is used.

The SAS System uses the specified index if the following restrictions are true:

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 IDXNAME= usage be noted in the SAS log if the setting affects index processing.  [cautionend]


Comparisons

IDXWHERE= enables you to override the SAS System decision about whether to use an index.


Examples

Example 1: Using a Specific Index

This example uses the IDXNAME= data set option to direct SAS to use a specific index to optimize the WHERE expression. SAS then disregards the possibility that a sequential search of the data set might be more resource-efficient and does not attempt to determine if the specified index is the best one. (Note that the EMPNUM index was not created with the NOMISS option.)

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

See Also

Data Set Option:
IDXWHERE=
"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.