VSAM DEFINE CLUSTER is used to define attributes for the cluster as a whole or for the components like data and index of the cluster. In other words, the parameters can be specified on the Cluster or Data Component, or Index Component. Usually, a sequence of commands commonly used in a single job step includes DELETE––DEFINE––REPRO or DELETE––DEFINE––BLDINDEX.
Syntax DEFINE CLUSTER (parameters) - [DATA(parameters)] - [INDEX(parameters)] - [CATALOG(subparameters)] Note: DEFINE Abbreviation: DEF
CLUSTER – It defines or re-catalogs a cluster or cluster entry. The CLUSTER keyword is followed by the parameters specified for the cluster as a whole. The CLUSTER keyword is followed by the parameters specified for the cluster as a whole. These parameters are enclosed in parentheses and, optionally, are followed by parameters given separately for the DATA and INDEX components.
Abbreviation: CL
NAME(entryname) – NAME parameter the cluster’s entryname or the name of each of its components. The entryname used for the cluster as a whole is not propagated to the cluster’s components.
Separate entrynames can be defined 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.
CYLINDERS(primary[ secondary])|
KILOBYTES(primary[ secondary])|
MEGABYTES(primary[ secondary])|
RECORDS(primary[ secondary])|
TRACKS(primary[ secondary])|
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 the override indicator in Data Class is set ON, the user-specified amount of space in DEFINE command will be overridden by the space values specified in the data Class. This enforces the installation standard of the system.
If you select KILOBYTES or MEGABYTES, the amount of space allocated is the minimum number of tracks or cylinders required to contain the specified number of kilobytes or megabytes. The maximum space can be specified with unit of KILOBYTES or MEGABYTES is 16,777,215. If the amount requested exceeds this value, you should specify a larger allocation unit.
If you select RECORDS, the amount of space allocated is the minimum number of tracks that are required to contain the given number of records. The maximum number of records is 16,777,215. If RECORDS is specified for a linear data set, space is allocated with the number of control intervals equal to the number of records.
The maximum TRACKS or CYLINDERS value that can be specified on the DEFINE CLUSTERS command is X’FFFFFF’ or 16777215, because of the 3 byte space parameter fields.
When multiple volumes are used for a data set, these rules and conditions apply:
Primary – Allocates the initial amount of space to the cluster.
Secondary – Allocates an amount of space each time the cluster extends, as a secondary extent.
Abbreviation: CYL – Cylinder, KB – Kilobyte, MB – Megabyte, REC – Record, TRK – Track
VOLUMES(volser[ volser…]) – Specifies the volumes on which a cluster’s components are to have space. VOLUMES must be used either as a parameter of CLUSTER, or as a parameter of both DATA and INDEX.
Abbreviation: VOL
BUFFERSPACE(size) – It specifies the minimum space for buffers.
size – The space for buffers. Size can be given in decimal (n), hexadecimal (X’n’), or binary (B’n’) form.
Abbreviations: BUFSP or BUFSPC
CONTROLINTERVALSIZE(size) – It defines the size of the control interval for the cluster or component.
size
Indicates a cluster’s data and index component size.
Abbreviations: CISZ or CNVSZ
ERASE|NOERASE – It specifies whether the cluster’s components are to be erased when its entry in the catalog is deleted.
ERASE – It overwrites each component of the cluster with binary zeros when its catalog entry is deleted. If the cluster is protected by a RACF generic or discrete profile and is cataloged, you can use RACF commands to specify an ERASE attribute. If you do this, the data component is automatically erased upon deletion.
Abbreviations: ERAS
NOERASE – It specifies that each component of the cluster is not to be overwritten with binary zeros. NOERASE will not prevent erasure if the cluster is protected by a RACF generic or discrete profile that specifies the ERASE attribute and if the cluster is cataloged. Use RACF commands to alter the ERASE attribute in a profile.
Abbreviations: NERAS
FILE(ddname) – It names the DD statement that identifies and allocates the DASD and 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 data and index components are to reside on separate devices, you can specify a separate FILE parameter as a parameter of DATA and INDEX to point to different DD statements.
Restriction:
When FILE refers to more than one 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) – It specifies the percentage of each control interval and control area to be set aside 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 preserved for adding new records and updating existing records with an increase in the length of the record. Since a CI is split when it becomes full, the CA might also need to be split when it is filled by CIs created by a CI split. The empty space in the control interval and control area is available for data records that are updated and inserted after the cluster is initially loaded. This parameter applies only to key-sequenced clusters, and variable-length relative records with variable-length records.
Abbreviations: FSPC
INDEXED|LINEAR|NONINDEXED|NUMBERED – These parameters are used to specify the type of data organization for the cluster. If you want a data organization other than INDEXED (the default), you must explicitly use it with this parameter.
The organization must be specified when a cluster is defined whether the data is to be indexed (key sequenced), nonindexed (entry sequenced), numbered (a relative record), or linear.
Linear data set clusters are treated as ESDS clusters that must be processed using control interval access. To define an entry-sequenced or a relative record cluster, you must specify the NONINDEXED, the NUMBERED, or the MODEL parameter.
INDEXED – It shows 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).
Abbreviations: IXD
LINEAR – It specifies that the cluster being defined is for linear data. Because linear data set clusters are treated as ESDS clusters that must be processed using control interval access, you can use most of the commands and parameters you use to manipulate ESDS clusters. There are two exceptions:
Space is allocated for a linear data set with the number of control intervals equal to the number of records. Linear data sets cannot be accessed for RLS processing. The LOG, LOGSTREAMID, and BWO parameters do not apply to linear data sets.
Restriction: Linear data sets cannot be accessed for VSAM RLS or DFSMStvs processing. The LOG, LOGSTREAMID, and BWO parameters do not apply to linear data sets.
Abbreviation: LIN
NONINDEXED – It indicates that the cluster being defined is for entry-sequenced data. The data records can be accessed sequentially or by relative-byte address (RBA).
Abbreviation: NIXD
NUMBERED – It specifies that the cluster’s data organization is for relative record data. A relative record cluster, which is similar to an entry-sequenced cluster, has fixed-length records or variable-length records that are stored in slots. The RECORDSIZE parameter determines if the records are fixed-length or variable-length. Empty slots hold space for records to be added later. The data records are accessed by relative record number (slot number).
Abbreviation: NUMD
KEYS(length offset|64 0) – It provides information about the prime key field of a key-sequence data set’s data records. This parameter overrides any KEYS specification on the DATACLASS parameter. This parameter applies only to key-sequenced clusters. The default is a key field of 64 bytes, beginning at the first byte (byte 0) of each data record.
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]) – It is 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.
entryname – Specifies the name of the cluster or component entry to be used as a model.
RECORDSIZE(average maximum|default) – It 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.
Abbreviation: RECSZ
SHAREOPTIONS(crossregion[ crosssystem]|1 3) – This parameter shows how a component or cluster can be shared among users. However, SMS-managed volumes, and catalogs containing SMS-managed data sets, must not be shared with non-SMS systems. To ensure integrity, you should be sure that share options specified at the DATA and INDEX levels are the same. The value of SHAREOPTIONS is assumed to be (3,3) when the data set is accessed in VSAM RLS or DFSMStvs mode.
crossregion – This parameter specifies the amount of sharing allowed among regions within the same system or within multiple systems using global resource serialization (GRS)
OPT 1 – 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. VSAM ensures complete data integrity for the data set.
OPT 2 – 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. It is the user’s responsibility to provide read integrity.
OPT 3 – 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.
OPT 4 – The data set can be fully shared by any number of users. For each request, VSAM refreshes the buffers used for direct processing.
crosssystem – crosssystem option specifies the amount of sharing allowed among systems.
OPT 1 – Reserved
OPT 2 – Reserved
OPT 3 – It 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 the user’s program accesses.
OPT 4 – It specifies that the data set can be fully shared. For each request, VSAM refreshes the buffers used for direct processing.
Abbreviation: SHR
SPEED|RECOVERY – 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 – Speed parameter does not preformat the data component’s space.
RECOVERY – 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.
Abbreviation: RCVY
TO(date)|FOR(days) – These parameters specify the retention period for the cluster being defined. If neither TO nor FOR is used, the cluster can be deleted at any time. The MANAGEMENTCLASS maximum retention period, if selected, limits the retention period specified by this parameter.
TO(date) – This parameter specifies the earliest date that a command without the PURGE parameter can delete an entry. Specify the expiration date in the form yyyyddd, where yyyy is a four-digit year (to a maximum of 2155) and ddd is the three-digit day of the year from 001 through 365 (for non-leap years) or 366 (for leap years).
FOR(days) – This parameter specifies the number of days you want to keep the cluster being defined. The maximum number is 93000. If the number is 0 through 92999 (except for 9999), the entry is retained for the number of days indicated. If the number is either 9999 or 93000, the entry is retained indefinitely. There is a hardware imposed expiration date of 2155.
DEFINE CLUSTER (NAME(entryname) {CYLINDERS(primary[ secondary])| KILOBYTES(primary[ secondary])| MEGABYTES(primary[ secondary])| RECORDS(primary[ secondary])| TRACKS(primary[ secondary])} VOLUMES(volser[ volser...]) [BUFFERSPACE(size)] [ERASE|NOERASE] [FILE(ddname)] [FREESPACE(CI-percent[ CA-percent]|0 0)] [INDEXED|LINEAR|NONINDEXED|NUMBERED|ZFS] [KEYS(length offset| 64 0] [OWNER(ownerid)] [RECORDSIZE(average maximum)] [REUSE|NOREUSE]) [DATA ( {CYLINDERS(primary[ secondary])| KILOBYTES(primary[ secondary])| MEGABYTES(primary[ secondary])| RECORDS(primary[ secondary])| TRACKS(primary[ secondary])} [VOLUMES(volser[ volser...])] [BUFFERSPACE(size)] [ERASE|NOERASE] [FILE(ddname)] [FREESPACE(CI-percent[ CA-percent])] [KEYS(length offset)] [NAME(entryname)] [OWNER(ownerid)] [RECORDSIZE(average maximum)] [REUSE|NOREUSE])] [INDEX ( {CYLINDERS(primary[ secondary])| KILOBYTES(primary[ secondary])| MEGABYTES(primary[ secondary])| RECORDS(primary[ secondary])| TRACKS(primary[ secondary])} [VOLUMES(volser[ volser...])] [CONTROLINTERVALSIZE(size)] [FILE(ddname)] [NAME(entryname)] [OWNER(ownerid)] [REUSE|NOREUSE])] [CATALOG(catname)]
//VSAMKSDS JOB (123),’KSDS’,MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID //*************************************************** //* TO DEFINE THE KEY SEQUENCED DATA SET (KSDS) //*************************************************** //STEP01 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(XXXXXXXX.YYYYYYYY.KSDS.CLUSTER) - INDEXED - RECORDSIZE(80,100) - TRACKS(10,10) - FREESPACE(3 3) - CISZ(4096) - NOREUSE - KEYS(4,0) - INDEX(NAME(XXXXXXXX.YYYYYYYY.KSDS.INDEX)) - DATA(NAME(XXXXXXXX.YYYYYYYY.KSDS.DATA) - /* OR //SYSIN DD * DEFINE CLUSTER - (NAME(XXXXXXXX.YYYYYYYY.KSDS.CLUSTER) - MODEL(XXXXXXXX.YYYYYYYY.MODEL.KSDS) - VOLUMES(VSER02)) /* OR //SYSIN DD * DEFINE CLUSTER - (NAME(XXXXXXXX.YYYYYYYY.KSDS.CLUSTER) - INDEXED - VOLUMES(VSER01) - RECORDS(100 50)) - DATA - (NAME(XXXXXXXX.YYYYYYYY.KSDS.DATA) - RECORDSIZE(80 100) - FREESPACE(20 10) - BUFFERSPACE(25000) - KEYS(4 0)) - INDEX - (NAME(XXXXXXXX.YYYYYYYY.KSDS.INDEX) - CATALOG (USERCAT) /*
Explanation:
The 2nd DEFINE command builds a cluster entry, a data entry, and an index entry to define the key sequenced cluster XXXXXXXX.YYYYYYYY.KSDS.CLUSTER. Its parameters are:
Parameters for the 3rd CLUSTER:
Parameters for the DATA:
Parameters for the INDEX component for the DATA:
KSDS cluster can be deleted using IDCAMS utility. DELETE command removes the VSAM cluster entry from the catalog and can also remove the file which release the space occupied.
DELETE DataSet-NAME CLUSTER [ERASE / NOERASE] [PURGE / NOPURGE] [SCRATCH / NOSCRATCH]
ERASE|NOERASE – It specifies whether the data component of a cluster (VSAM only) is to be overwritten with binary zeros when the cluster is deleted.
PURGE|NOPURGE – It specifies whether the entry is to be deleted even if the retention period, specified in the TO or FOR operand, has not expired.
SCRATCH|NOSCRATCH – It specifies whether a non-VSAM data set is to be scratched (removed) from the volume table of contents (VTOC) of the volume on which it resides. SCRATCH is the default.
Return codes | Meaning |
---|---|
0 | Processing successful. Informational messages might have been issued. |
4 | Processing successful, but a warning message has been issued. |
8 | Processing was completed, but specific details were bypassed. |
12 | Processing unsuccessful. |
16 | Severe error or problem encountered. |
VSAM DELETE CLUSTER – KSDS
//VSAMKSDS JOB (123),’KSDS’,MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID //*************************************************** //* TO DELETE THE KEY SEQUENCED DATA SET (KSDS) //*************************************************** //STEP01 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DELETE - EXAMPLE.KSDS1 - FILE(DD1) PURGE - ERASE - CATALOG(USERCAT) /*
Explanation:
Its parameters are:
//VSAMESDS JOB (123),’ESDS’,MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID //*************************************************** //* SAMPLE JCL TO CREATE ENTRY SEQUENCED DATA SET(ESDS) //*************************************************** //STEP01 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(XXXXXXXX.YYYYYYYY.ESDS.CLUSTER) - VOLUMES(VSER02) - NONINDEXED - RECORDS(100 100) - RECORDSIZE(80 80)) - CATALOG(USERCAT4) DEFINE CLUSTER - (NAME(XXXXXXXX.YYYYYYYY.ESDS.CLUSTER) - MODEL(XXXXXXXX.YYYYYYYY.ESDS.CLUSTER USERCAT4)) - CATALOG(USERCAT4) /*
The first DEFINE CLUSTER command defines an entry-sequenced cluster, XXXXXXXX.YYYYYYYY.ESDS.CLUSTER. Its parameters are:
The second DEFINE CLUSTER command uses the attributes and specifications of the previously defined cluster, XXXXXXXX.YYYYYYYY.ESDS.CLUSTER, as a model for the cluster still to be defined, XXXXXXXX.YYYYYYYY.ESDS.CLUSTER. A list of the parameters follows:
VSAM DEFINE CLUSTER – RRDS
//VSAMRRDS JOB OZA,OZA,MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID //*************************************************** //*SAMPLE JCL TO CREATE RRDS //*************************************************** //STEPOZA EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(XXXXXXX.YYYYYYYY.RRDS.CLUSTER) - NUMBERED - RECORDSIZE(100,50) - TRACKS(10,5) - FREESPACE(3 3) ) - REUSE - DATA (NAME(XXXXXXX.YYYYYYYY.RRDS.DATA)) - /* OR //SYSIN DD * DEFINE CLUSTER - (NAME(XXXXXXX.YYYYYYYY.RRDS.CLUSTER) - RECORDSIZE(100 100) - VOLUMES(VSER01) - TRACKS(10 5) - NUMBERED) - CATALOG(USERCAT) /*
The DEFINE CLUSTER command builds a cluster entry and a data entry to define the relative record cluster XXXXXXX.YYYYYYYY.RRDS.CLUSTER in the user catalog. The DEFINE CLUSTER command allocates ten tracks for the cluster’s use. The command’s parameters are:
VSAM DEFINE CLUSTER – LDS
//VSAMLDS JOB 'ALLOCATE LINEAR',MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID //*************************************************** //* SAMPLE JCL TO CREATE ENTRY SEQUENCED DATA SET(LDS) //*************************************************** //STEP01 EXEC PGM=IDCAMS,REGION=0M //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(XXXXXXX.YYYYYYYY.LDS.CLUSTER) - LINEAR - TRACKS(10,5) - CISZ(4096) - NOREUSE - DATA (NAME(XXXXXXX.YYYYYYYY.LDS.DATA)) - /* OR //SYSIN DD * DEFINE CLUSTER - (NAME(XXXXXXX.YYYYYYYY.LDS.CLUSTER) - VOLUMES(VSER03) - TRACKS(20 10) - LINEAR - CATALOG(USERCAT) /*
The DEFINE CLUSTER command builds a cluster entry and a data entry to define the linear data set cluster EXAMPLE.LDS01. The parameters are:
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…
The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…
The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…
Choosing the right Scrum Master Certification depends on your current experience and career goals. If…