In this example, an SMS-managed alternate index is defined. Because
a data class is specified and no overriding attributes are explicitly
specified, this define will be unsuccessful if SMS is inactive.
//DEFAIX JOB ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE ALTERNATEINDEX -
(NAME(EXMP1.AIX) -
RELATE(EXAMPLE.SMS1) -
DATACLAS(VSALLOC) -
NONUNIQUEKEY -
UPGRADE)
/*
The DEFINE ALTERNATEINDEX command creates an alternate index entry,
a data entry, and an index entry to define the alternate index EXMP1.AIX.
The parameters are:
- NAME indicates that the alternate index's name is EXMP1.AIX.
- RELATE identifies the alternate index base cluster,
EXAMPLE.SMS1. Because an SMS-managed alternate index is being defined,
the base cluster must also be SMS-managed.
- DATACLAS is an installation-defined name of an SMS
data class. The data set assumes the RECORG or RECFM, LRECL, KEYLEN,
KEYOFF, AVGREC, SPACE, EXPDT or RETPD, VOLUME, CISIZE, FREESPACE,
and SHAREOPTIONS parameters assigned to this data class by the ACS
routines. This parameter is optional. If it is not used, the data
set will assume the data class default assigned by the ACS routines.
- NONUNIQUEKEY specifies that the alternate key value might be the
same for two or more data records in the base cluster.
- UPGRADE specifies that the alternate index is to be opened by
VSAM and upgraded each time the base cluster is opened for processing.