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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.