Creating Indexes in the DATA Step

Overview

To create an index at the same time that you create a data set, use the INDEX= data set option in the DATA statement.
General form, DATA statement with the INDEX= option:
DATA SAS-data-file-name (INDEX=
(index-specification-1</UNIQUE><...index-specification-n>
</UNIQUE>));
Here is an explanation of the syntax:
SAS-data-file-name
is a valid SAS data set name.
index-specification
for a simple index is the name of the key variable.
index-specification
for a composite index is (index-name=(variable-1...variable-n)).
UNIQUE
specifies that values for the key variable must be unique for each observation.
You can create multiple indexes on a single SAS data set. However, ...

Get SAS Certification Prep Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.