JCL

VSAM DEFINE CLUSTER using IDCAMS with Examples

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

VSAM DEFINE CLUSTER – Mandatory Parameters

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:

  • The first volume is defined as the prime volume. The initial allocation of a data set is on the prime volume. The remaining volumes are defined as candidate volumes.
  • A data set’s primary space allocation (defined for each data set) is the amount of space initially allocated on both the prime volume and on any candidate volumes the data set extends to. If the data set is stripped then the space is allocated for each stripe. To allocate a data set of a particular size divide the space by the number of stripes. Note the size may be rounded up or down, so check using LISTCAT ENT(…) ALLOC.
  • 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.
  • If a data set extends to a candidate volume, the amount of space initially allocated on the candidate volume is the primary space allocation. If the data set extends beyond the primary allocation on the candidate volume, then the amount of space allocated is the secondary space allocation.
  • With a DEFINE request, the primary space allocation must be fulfilled in five DASD extents unless the Space Constraint Relief option is specified in the associated SMS data class.However, the request is not successful if you do not fulfill each secondary space allocation in five DASD extents.

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

VSAM DEFINE CLUSTER Optional Parameters

BUFFERSPACE(size) – It specifies the minimum space for buffers.

  • If BUFFERSPACE is not coded, VSAM attempts to get enough space to contain two data component control intervals and, if the data is key-sequenced, one index component control interval.
  • If the data set being defined is a KSDS, and the BUFFERSPACE specified is not large enough to contain two data and one index CIs, VSAM increases the specified buffer space and completes the define. VSAM may also increase index CISIZE and, if necessary, increase the buffer space to accommodate the larger index CISIZE.

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.

  • If CONTROLINTERVALSIZE is given on the cluster level, it propagates 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 you provide.
  • If CONTROLINTERVALSIZE is not coded, VSAM determines the size of control intervals. VSAM selects a control interval size for the data component that will optimize direct access storage usage. It will then select an index control interval size based on the number of data control intervals in the data control area. If the override indicator in Data Class is set ON, the user-specified CISIZE in DEFINE command will be overridden by the CISIZE in the DATACLAS.

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:

  • Parameters that refer to logical records are not allowed (except RECORDS).
  • Use partial printing by specifying the RBA syntax.

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 – Syntax with Parameters

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)]

VSAM DEFINE CLUSTER – KSDS

//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:

  • NAME specifies the name of the key-sequenced cluster, XXXXXXXX.YYYYYYYY.KSDS.CLUSTER.
  • MODEL identifies XXXXXXXX.YYYYYYYY.MODEL.KSDS as the cluster to use as a model for XXXXXXXX.YYYYYYYY.KSDS.CLUSTER. The attributes and specifications of XXXXXXXX.YYYYYYYY.MODEL.KSDS that are not otherwise specified with the DEFINE command parameters are used to define the attributes and specifications of XXXXXXXX.YYYYYYYY.KSDS.CLUSTER is located in the user catalog.
  • VOLUMES specifies that the cluster is to reside on volume VSER02.

Parameters for the 3rd CLUSTER:

  • NAME indicates that the cluster’s name is XXXXXXXX.YYYYYYYY.KSDS.CLUSTER.
  • VOLUMES is used when the cluster is to reside on volume VSER01.
  • RECORDS specifies that the cluster’s space allocation is 100 data records. The cluster is extended in increments of 50 records. After the space is allocated, VSAM calculates the amount required for the index and subtracts it from the total.

Parameters for the DATA:

  • NAME indicates that the data component’s name is XXXXXXXX.YYYYYYYY.KSDS.DATA.
  • KEYS shows that the length of the key field is 4 bytes and that the key field begins in the first byte (byte 0) of each data record.
  • RECORDSIZE specifies fixed-length records of 80 bytes.
  • BUFFERSPACE verifies that a minimum of 25000 bytes must be provided for I/O buffers. A large area for I/O buffers can help to improve access time with certain types of processing. For example, with direct processing if the high-level index can be kept in virtual storage, access time is reduced. With sequential processing, if enough I/O buffers are available, VSAM can perform a read-ahead, thereby reducing system overhead and minimizing rotational delay.
  • FREESPACE specifies that 20% of each control interval and 10% of each control area are to be left free when records are loaded into the cluster. After the cluster’s records are loaded, the free space can be used to contain new records.

Parameters for the INDEX component for the DATA:

  • NAME specifies that the index component’s name is XXXXXXXX.YYYYYYYY.KSDS.INDEX.
  • CATALOG specifies the catalog name.

Deleting KSDS Cluster

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 codesMeaning
0Processing successful. Informational messages might have been issued.
4Processing successful, but a warning message has been issued.
8Processing was completed, but specific details were bypassed.
12Processing unsuccessful.
16Severe 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:

  • XXXXXXXX.YYYYYYYY.KSDS.CLUSTER, which is a key-sequenced VSAM cluster, is the entryname of the object being deleted.
  • FILE is not required but improves performance if specified.
  • PURGE specifies that the cluster is to be deleted regardless of its retention period or date.
  • ERASE specifies that the cluster’s data component be overwritten with binary zeros. If the NOERASE attribute was specified when the cluster was defined or altered, this is ignored.
  • CATALOG identifies the catalog, USERCAT, containing the cluster’s entries.

VSAM DEFINE CLUSTER – ESDS

//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:

  • NAME specifies the name of the entry-sequenced cluster, XXXXXXXX.YYYYYYYY.ESDS.CLUSTER.
  • VOLUMES specifies that the cluster is to reside on volume VSER02.
  • RECORDS specifies that the cluster’s space allocation is 100 records. When the cluster is extended, it is extended in increments of 100 records.
  • RECORDSIZE specifies that the cluster’s records are fixed length (the average record size equals the maximum record size) and 80 bytes long.
  • NONINDEXED specifies that the cluster is entry-sequenced.

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:

  • NAME specifies the name of the entry-sequenced cluster, XXXXXXXX.YYYYYYYY.ESDS.CLUSTER.
  • MODEL identifies XXXXXXXX.YYYYYYYY.ESDS.CLUSTER, cataloged in user catalog USERCAT4, as the cluster to use as a model for XXXXXXXX.YYYYYYYY.ESDS.CLUSTER. The attributes and specifications of GENERIC.A.BAKER that are not otherwise specified with the DEFINE command’s parameters are used to define the attributes and specifications of XXXXXXXX.YYYYYYYY.ESDS.CLUSTER.
  • CATALOG specifies that the cluster is to be defined in the USERCAT4 catalog.

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:

  • NAME specifies that the cluster’s name is XXXXXXX.YYYYYYYY.RRDS.CLUSTER.
  • RECORDSIZE specifies that the records are fixed-length, 100 byte records. Average and maximum record length must be equal for a fixed-length relative record data set, but not equal for a variable-length RRDS.
  • VOLUMES specifies that the cluster is to reside on volume VSER01. This example assumes that the volume is already cataloged in the user catalog, USERCAT.
  • TRACKS specifies that 10 tracks are allocated for the cluster. When the cluster is extended, it is to be extended in increments of 5 tracks.
  • NUMBERED specifies that the cluster’s data organization is to be relative record.
  • CATALOG specifies the catalog name.

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:

  • NAME specifies that the cluster’s name is XXXXXXX.YYYYYYYY.LDS.CLUSTER.
  • VOLUMES specifies that the cluster is to reside on volume VSER03.
  • TRACKS specifies that 20 tracks are allocated for the cluster’s space. When the cluster is extended, it is to be extended in increments of 10 tracks.
  • LINEAR specifies that the cluster’s data organization is to be linear.
  • CATALOG specifies that the cluster is to be defined in a user catalog, USERCAT.

VSAM Tutorials

VSAM Alternet Index : Click Here IBM Reference: Click Here

Admin

Share
Published by
Admin

Recent Posts

Increase Transparency and Collaboration Product Backlog

A well-maintained product backlog is crucial for successful product development. It serves as a single…

2 months ago

Product Backlog – Incremental value to the customer

Incremental value to the customer refers to the gradual delivery of small, functional parts of…

2 months ago

Product Market, Customer’s Desire, Need, and Challenges

A Product Market refers to the group of potential customers who might be interested in…

2 months ago

PAL-EBM Professional Agile Leadership – EBM Certification

The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…

5 months ago

PAL I Professional Agile Leadership Certification

The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…

5 months ago

Scrum Master Certification: CSM, PSM, SSM

Choosing the right Scrum Master Certification depends on your current experience and career goals. If…

7 months ago