General form, DATA statement
with the INDEX= option:
DATA SAS-data-file-name (INDEX=
(index-specification-1</UNIQUE><...index-specification-n>
</UNIQUE>));
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.
|
data simple (index=(division)); set sasuser.empdata; run;
data simple2 (index=(division empid/unique)); set sasuser.empdata; run;The following example creates a composite index on the Composite data set. The index is named Empdiv, and it contains concatenated values of the Division variable and the EmpID variable.
data composite (index=(Empdiv=(division empid))); set sasuser.empdata; run;
General form, MSGLEVEL=
system option:
OPTIONS MSGLEVEL= N|I;
N
prints notes, warnings,
and error messages only. This is the default.
I
prints additional notes
or INFO messages pertaining to index usage, merge processing, and
sort utilities along with standard notes, warnings, and error messages.
|
options msglevel=i; data sasuser.sale2000(index=(origin flightdate=(flightid date)/unique)); infile sale2000 dsd; input FlightID $ RouteID $ Origin $ Dest $ Cap1st CapBusiness CapEcon CapTotal CapCargo Date Psgr1st PsgrBusiness PsgrEcon Rev1st RevBusiness RevEcon SaleMon $ CargoWgt RevCargo; format date date9.; run;
NOTE: The infile SALE2000 is: File Name=C:My SAS Files9.0sale2000.dat, RECFM=V,LRECL=256 NOTE: 153 records were read from the infile SALE2000. The minimum record length was 82. The maximum record length was 100. NOTE: The data set SASUSER.SALE2000 has 153 observations and 19 variables. NOTE: Composite index flightdate has been defined. NOTE: Simple index origin has been defined. NOTE: DATA statement used (Total process time): real time 1.08 seconds cpu time 0.04 seconds |