In this example, a key-sequenced cluster is defined. In other examples,
an alternate index is defined over the cluster, and a path is defined
that relates the cluster to the alternate index. The cluster, its
alternate index, and the path entry are all defined in the same catalog,
USERCAT.
//DEFCLU6 JOB ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE CLUSTER -
(NAME(EXAMPLE.KSDS2)) -
DATA -
(RECORDS(500 100) -
EXCEPTIONEXIT(DATEXIT) -
ERASE -
FREESPACE(20 10) -
KEYS(6 4) -
RECORDSIZE(80 100) -
VOLUMES(VSER01) ) -
INDEX -
(RECORDS(300 300) -
VOLUMES(VSER01) ) -
CATALOG(USERCAT)
/*
The DEFINE CLUSTER command builds a cluster entry, a data entry,
and an index entry to define the key-sequenced cluster, EXAMPLE.KSDS2.
The DEFINE CLUSTER command allocates space separately for the cluster's
data and index components.
The parameter that applies to the cluster is NAME, which specifies
that the cluster's name is EXAMPLE.KSDS2.
The parameters that apply only to the cluster's data component
are enclosed in the parentheses following the DATA keyword:
- RECORDS specifies that an amount of tracks equal to at least 500
records is to be allocated for the data component's space. When the
data component is extended, it is to be extended in increments of
tracks equal to 100 records.
- EXCEPTIONEXIT specifies the name of the exception exit routine,
DATEXIT, that is to be processed if an I/O error occurs while a data
record is being processed.
- ERASE specifies that the cluster's data is to be erased (overwritten
with binary zeros) when the cluster is deleted.
- FREESPACE specifies the amounts of free space to be left in the
data component's control intervals (20%) and the control areas (10%
of the control intervals in the control area) when data records are
loaded into the cluster.
- KEYS specifies the location and length of the key field in each
data record. The key field is 6 bytes long and begins in the fifth
byte (byte 4) of each data record.
- RECORDSIZE specifies that the cluster's records are variable length,
with an average size of 80 bytes and a maximum size of 100 bytes.
- VOLUMES specifies that the cluster is to reside on volume VSER01.
The parameters that apply only to the cluster's index component
are enclosed in the parentheses following the INDEX keyword:
- RECORDS specifies that an amount of tracks equal to at least 300
records is to be allocated for the index component's space. When the
index component is extended, it is to be extended in increments of
tracks equal to 300 records.
- VOLUMES specifies that the index component is to reside on volume
VSER01.
The CATALOG parameter specifies that the cluster is to be defined
in a user catalog, USERCAT4.