Define Cluster
DEFINE CLUSTER command creates new VSAM datasets (i.e., ESDS, KSDS, RRDS and LDS). It define attributes for the cluster as a whole, the DATA and INDEX components of the cluster. A cluster consists of both the index and the data components of a VSAM dataset, and optionally, a catalog entry.
Syntax -
//JOBNAME JOB job-card-parameters
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER
(NAME(entryname)
[INDEXED|LINEAR|NONINDEXED|NUMBERED]
[SHAREOPTIONS(crossregion[ crosssystem]|1 3)]
[TO(date)|FOR(days)]
[cd_common_parameters]
[cdi_common_parameters])
[DATA (
[NAME(entryname)]
[cd_common_parameters]
[cdi_common_parameters])]
[INDEX (
[NAME(entryname)]
[cdi_common_parameters])]
[CATALOG(catname)]
/*
cd_common_parameters applicable to Cluster, DATA, and INDEX -
[BUFFERSPACE(size)]
[ERASE|NOERASE]
[FREESPACE(CI-percent[ CA-percent])]
[KEYS(length offset)]
[RECORDSIZE(average maximum)]
[SPANNED|NONSPANNED]
[SPEED|RECOVERY]
cdi_common_parameters applicable to Cluster, DATA, and INDEX -
{CYLINDERS(primary[ secondary])|
KILOBYTES(primary[ secondary])|
MEGABYTES(primary[ secondary])|
RECORDS(primary[ secondary])|
TRACKS(primary[ secondary])}
[VOLUMES(volser[ volser...])]
[CONTROLINTERVALSIZE(size)]
[DATACLASS(class)]
[FILE(ddname)]
[REUSE | NOREUSE]
[ORDERED | UNORDERED]
[MODEL(entryname[ catname])]
[OWNER(ownerid)]
[SHAREOPTIONS(crossregion[ crosssystem]|1 3)]
[WRITECHECK | NOWRITECHECK]
Mandatory Parameters
- CLUSTER - defines the clusters. The parameters coded with the CLUSTER are applied to the whole cluster that is going to create. Short Description: CL
- NAME (entryname) - specifies the name of the VSAM cluster to be defined. This name must be unique within the catalog. entrynames are different for the cluster, its DATA component, and its INDEX component. The name is automatically generated if no names are coded for the DATA or INDEX component. The name of the cluster can be up to 44 alphanumeric characters.
- CYLINDERS (primary[ secondary])
KILOBYTES (primary[ secondary])
MEGABYTES (primary[ secondary])
RECORDS (primary[ secondary])
TRACKS (primary[ secondary]) - used to specify the amount of space allocated to the cluster, DATA and INDEX component in CYLINDERS (CYL), KILOBYTES (KB), MEGABYTES (MB), RECORDS (REC), or TRACKS (TRK) from the volume's available space. Short Description: CYL, KB, MB, REC, TRK
primary - specifies the amount of space that should allocate initially.
secondary specifies an amount of space required each time when it extends. - VOLUMES (volser[ volser...]) - Specifies the volume serial numbers where the dataset will reside. If there is not enough space on the volume as specified, the allocation is unsuccessful. Short Description: VOL
Optional Parameters
- BUFFERSPACE (size) - Specifies the amount of space to allocate for buffers. Short Description: BUFSP or BUFSPC
- CONTROLINTERVALSIZE (size) - Specifies the control interval size, which affects how data is stored and retrieved. If it is coded at the cluster level, it applies to the all components where it is not coded. If it is not coded, CLUSTER determines the size of control intervals. Short Description: CISZ or CNVSZ
- DATACLASS (class) - Specifies dataclass for the new datasets. The storage administrator provides the data class name (1-8 characters). Short Description: DATACLAS
- ERASE | NOERASE - Default: NOERASE
- ERASE - specifies the cluster components memory is to be erased with binary zeroes when cluster is deleted. Short Description: ERAS
- NOERASE - specifies the cluster components memory is not to be erased when cluster is deleted. Short Description: NERAS
- FILE (DDname) - specifies DDname that identifies the file.
- FREESPACE (CI-percent[ CA-percent]|0 0) - Specifies the percentage of each control interval and control area to leave free for future insertions. Short Description: FSPC. Default: FREESPACE (0 0)
- INDEXED | LINEAR | NONINDEXED | NUMBERED - used to specify the type of data organization for the cluster. If the parameter is not coded, the default value is INDEXED. The valid file organizations are INDEXED (for KSDS), NONINDEXED (for ESDS), NUMBERED (for RRDS), or LINEAR (for LDS). Short Description: IXD or LIN or NIXD or NUMD
- KEYS (length offset | 64 0) - specifies the primary key field in the data record. It specifies key length and its displacement (in bytes) positions from the offset of the record. Default: KEYS (64 0)
- MODEL (entryname[ catname]) - specifies existing file name that is used as a model while creating a new file.
- OWNER (ownerid) - specifies the cluster owner.
- RECORDSIZE (average maximum|default) - specifies the average and maximum lengths of the records in bytes. The minimum record size is 1 byte. Short Description: RECSZ
- REUSE | NOREUSE -
- REUSE - allows the dataset to be reused if it is deleted and then recreated. Short Description: RUS
- NOREUSE - indicates that the dataset is not reused after being deleted. Short Description: NRUS
- SHAREOPTIONS (crossregion[ crosssystem]|1 3) - defines how the dataset can be shared among different regions and systems. Short Description: SHR. Default: SHR (1 3). crossregion specifies the amount of sharing allowed among regions. Valid values are 1 to 4. crosssystem option specifies the amount of sharing allowed among systems. Valid values are 1 to 4.
- SPANNED | NONSPANNED -
- SPANNED - allows records to span across control intervals. Short Description: SPND
- NONSPANNED - specifies that records must fit within a single control interval. Short Description: NSPND
- SPEED (does not preformat) | RECOVERY (does preformat) - specifies whether the data component control areas are to be preformatted before cluster records are loaded into them. Default: SPEED. Short Description: SPEED or RCVY
- TO (date) | FOR (days) - specifies the retention period for the cluster. If neither TO nor FOR is used, the cluster can be deleted at any time.
- WRITECHECK | NOWRITECHECK - specifies twhether the cluster or component is to be reviewed when a record is being written into it. Short Description: WCK or NWCK
- CATALOG (catname) - Specifies the catalog name in which the cluster is to be defined. Short Description: CAT
Examples -
Scenario - Create ESDS with fixed-length records of size 47 bytes.
JCL -
----+----1----+----2----+----3----+----4----+----5
...
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
(NAME(MATEPK.TEST.ESDS) -
RECORDSIZE(47,47) -
CYLINDERS(2,1) -
CISZ(4096) -
VOLUMES(DEVHD4) -
NONINDEXED -
REUSE ) -
DATA(NAME(MATEPK.TEST.ESDS.DATA))
/*
...
Output -
Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, ESDS successfully created.
Verify the ESDS in 3.4 (Dataset List utility) or any File management tools.
Explaining Example -
In the above example,
- RECORDSIZE(47,47) specifies the record average length is 47, and the maximum size is 47. So the ESDS file we are creating is fixed-length.
- CYLINDERS(2,1) specifies the primary memory allocation is 2 CYLINDERS, and secondary memory allocation is 1 CYLINDER.
- CISZ(4096) specifies the control interval size is 4096.
- VOLUMES(DEVHD4) specifies that allocate the ESDS on volume DEVHD4.
- NONINDEXED parameter specifies the file is to create ESDS.
- REUSE specifies the memory can reuse immediately once the file gets deleted.