IDCAMS Define Cluster

IDCAMS Introduction IDCAMS Alternate Index


DEFINE CLUSTER to define attributes for the cluster as a whole and for the data and index components of the cluster.

The syntax of the DEFINE CLUSTER command like below:


The DEFINE CLUSTER command uses to create the VSAM datasets and the below listed is the mandatory and optional parameters.

Mandatory parameters


Cluster used to defines the cluster or re-catalogs cluster entry.

The Parameters specified with CLUSTER keyword are applied to the whole cluster that is going to create.

The parameters are enclosed [ ] are optional and remaining keywords are optional for the DATA and INDEX components.

Short Description: CL


NAME parameter specifies/used to define the cluster's entry name or the name of each of its components.

The entryname used for the cluster as a complete and is not transmitted to the cluster's components.

entrynames can be separated for the cluster, its data component, and its index component.

If no name is specified for the data or index component, a name is generated. When the cluster, data component, and index component are individually named, each can be addressed

The name for a VSAM dataset can include up to 44 alphanumeric characters.

CYLINDERS(primary[ secondary])|
KILOBYTES(primary[ secondary])|
MEGABYTES(primary[ secondary])|
RECORDS(primary[ secondary])|
TRACKS(primary[ secondary])|

The above parameters specify the amount of space in cylinders, kilobytes, megabytes, records, or tracks allocated to the cluster from the volume's available space.

A kilobyte or megabyte allocation resolves to either tracks or cylinders; record allocation resolves to tracks.

If KILOBYTES or MEGABYTES selected, the amount of space allocated is the minimum number of tracks or cylinders required to contain the specified number of kilobytes or megabytes.

If RECORDS selected, the amount of space allocated is the minimum number of tracks that are required to contain the given number of records.

Regardless of the allocation type, The CA (control area) size will be calculated based on the smaller of the two allocation quantities (primary or secondary) in the DEFINE command but not based on the allocation type. A CA is never greater than a single cylinder, it might be less (that is, some number of tracks), depending on the allocation amount and type used.

When multiple volumes are used for a data set:

• The first volume is defined as the prime volume. The initial allocation of a data set is on the prime volume.

• A data set's secondary space allocation (if it is defined) is the space allocated when the primary space is filled and the data set needs additional space on the same volume.

• CLUSTER, the space amount is divided between the data and index components. The division can be done based on the control interval size, record size, device type, and other data set attributes.

• DATA, the entire amount specified is allocated to the data component. An additional amount of space, depending on control interval size, record size, device type, and other data set attributes, is allocated to the index component.


Allocates the initial amount of space to the cluster.


Allocates an amount of space each time the cluster extends, as a secondary extent.

Short Description: CYL, KB, MB, REC, TRK

VOLUMES(volser[ volser...])

VOLUMES parameter specifies the volume name on whichVSAM needs to be created.

VOLUMES must be used either as a parameter of CLUSTER, or as a parameter of both DATA and INDEX.

Volumes are always allocated in the order specified. If there is not enough space on the volume, the allocation is not successful.

Short Description: VOL

Optional parameters


BUFFERSPACE parameter used to specify the minimum space for buffers.

The buffer space size used by the VSAM to determine the data component's and index component's control interval size.

If BUFFERSPACE is not provided, VSAM attempts to get enough space to contain two data component control intervals and one index component control interval if the data is key sequenced.


The size cannot be less than enough space to contain two data component control intervals and, if the data is key sequenced, one index control interval.

Short Description:  BUFSP or BUFSPC


CONTROLINTERVALSIZE parameter specifies the size of the control interval for the cluster or component.

If CONTROLINTERVALSIZE is given on the cluster level, it transmits to the component level at which no CONTROLINTERVALSIZE has been specified.

The size of the control interval depends on the maximum size of the data records and the amount of buffer space provided in cluster definition.

If CONTROLINTERVALSIZE is not coded, VSAM determines the size of control intervals.


Indicates a cluster's data and index component size.

Short Description: CISZ or CNVSZ


ERASE|NOERASE used to specify the cluster's components are to be erased/No erase when its entry in the catalog is deleted.


ERASE parameter overwrites each component of the cluster with binary zeros when its catalog entry is deleted

Short Description: ERAS

NOERASE parameter specifies that each component of the cluster is not to be overwritten with binary zeros.

Short Description: NERAS


FILE parameter names the DD statement that identifies and allocates the volumes that must be available for space allocation on the volumes specified by the VOLUMES keyword.

If more than one volume is specified, all volumes must be the same device type.

If the FILE parameter is not specified, an attempt is made to dynamically allocate the required volumes.


When FILE refers to multi-volume of the same device type, the DD statement that describes the volumes cannot be a concatenated DD statement.

FREESPACE(CI-percent[ CA-percent]|0 0)

FREESPACE specifies the percentage of each control interval and control area to be set as free space when the cluster is initially loaded or when a mass insert is done.

CI-percent is a percentage of the amount of space to be kept a side for adding new records and updating existing records with an increase in the length of the record.

CI-percent is the number of bytes that is equal to, or slightly less than, the percentage value of CI-percent.

CA-percent is the number of control intervals equal to, or less than, the percentage of CA-percent.

CI-percent and CA-percent must be equal to, or less than, 100.

Short Description: FSPC


The above parameter is used to specify the type of data organization for the cluster.

If the parameter not specified the default organization is INDEXED (the default).

The organization must be specified when a cluster is defined whether the data is to be indexed (key sequenced), nonindexed (entry sequenced), numbered (relative record), or linear.

Linear data set clusters are treated as ESDS clusters that must be processed using control interval access.

If you want to define an entry-sequenced or a relative record cluster, must specify the NONINDEXED, the NUMBERED, or the MODEL parameter.


INDEXED parameter specifies that the cluster being defined is for key-sequenced data.

If INDEXED is specified, an index component is automatically defined and cataloged. The data records can be accessed by key or by relative-byte address (RBA).

Short Description: IXD
Short Description: LIN

NONINDEXED parameter indicates that the cluster being defined is for entry-sequenced data.

Short Description: NIXD

NUMBERED parameter specifies that the cluster's data organization is for relative record data.

Short Description: NUMD

KEYS(length offset|64 0)

KEYS parameter specifies the information about the prime key field of a key-sequenced data set's data records.

This parameter overrides any KEYS specification in the DATACLASS parameter.

length offset

Specifies the length of the key and its displacement (in bytes) from the beginning of the record.

The sum of length plus offset cannot exceed the length of the shortest record.

MODEL(entryname[ catname])

MODEL parameters used to specify an existing entry to be used as a model for the entry being defined.

The DATACLASS, MANAGEMENTCLASS, and STORAGECLASS attributes are not modeled.


Specifies the name of the cluster or component entry to be used as a model.


Names the model entry's catalog.

RECORDSIZE(average maximum|default)

RECORDSIZE specifies the average and maximum lengths, in bytes, of the records in the data component. The minimum record size is 1 byte.

RECORDSIZE can be given as a parameter of either CLUSTER or DATA.

This parameter overrides the LRECL specification on the DATACLASS parameter.


Short Description: RECSZ

SHAREOPTIONS(crossregion[ crosssystem]|1 3)

SHAREOPTIONS parameter specifies the sharing options of how a component or cluster can be shared among users.

The value of SHAREOPTIONS is assumed to be (3,3) when the data set is accessed in VSAM


crossregion specifies the amount of sharing allowed among regions within the same system or within multiple systems using global resource serialization (GRS).


The data set can be shared by any number of users for read processing, or the data set can be accessed by only one user for read and write processing.


The data set can be accessed by any number of users for read processing, and it can also be accessed by one user for write processing.


The data set can be fully shared by any number of users. Each user is responsible for maintaining both read and write integrity for the data the program accesses.


The data set can be fully shared by any number of users.


crosssystem option specifies the amount of sharing allowed among systems.






OPT 3 specifies that the data set can be fully shared. With this option, each user is responsible for maintaining both read and write integrity for the data that user's program accesses.


OPT 4 indicates that the data set can be fully shared. For each request, VSAM refreshes the buffers used for direct processing.

Short Description: SHR


SPEED|RECOVERY parameter specifies whether the data component's control areas are to be preformatted before alternate index records are loaded into them.

This parameter is only considered during the actual loading (creation) of a data set.


Speed parameter does not preformat the data component's space.


RECOVERY parameter specifies that the data component's control areas are written with records that indicate end-of-file.

RECOVERY is a way to verify storage that is used on the device for each CA before the data is actually written.

Short Description: RCVY


TO/FOR parameters specifies the retention period for the cluster being defined. If neither TO nor FOR is used, the cluster can be deleted at any time.


TO parameter specify the date up to which to keep the cluster before it is allowed to be deleted.

The date is given in the form [yy]yyddd, in which yyyy is a four-digit year, yy is a two-digit year, and ddd is a three-digit day of the year (001 through 366).


FOR parameter shows the number of days to keep the cluster being defined.

The maximum number is 9999.

If the number is 0 through 9998, the cluster is retained for the number of days; if the number is 9999, the cluster is retained indefinitely.


WRITECHECK|NOWRITECHECK parameters indicates whether the cluster or component is to be checked by a machine action called write check when a record is written into it.


WRITECHECK parameter shows that a record is written and then r-ead, without data transfer, to test for the data check condition.

Short Description: WCK


NOWRITECHECK parameter specifies that the cluster or component is not to be checked by a write check.

Short Description: NWCK

IDCAMS Introduction IDCAMS Alternate Index