How to Define Various VSAM Clusters with IDCAMS

Defining VSAM files with IDCAMS utility is easy. IDCAMS is the utility specially developed for VSAM file organizations (You can use non-VSAM files also). The organizations that you you can define with IDCAMS are KSDS, ESDS, RRDS, VRRDS and LDS.

How to Define Various VSAM Clusters with IDCAMS
VSAM Cluster Parameters

DEFINE VSAM CLUSTER

Here is an example that you can use to define cluster.

//DEFCLU2  JOB    ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE CLUSTER -
...
DEFINE CLUSTER -
...
/*

Define KSDS

Here you can use INDEXED parameter that tells the cluster in define relates to KSDS.

//DEFCLU1  JOB    ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE CLUSTER -
(NAME(VWX.MYDATA) -
VOLUMES(VSER02) -
RECORDS(1000 500) -
INDEXED ) -
DATA -
(NAME(VWX.KSDATA) -
KEYS(15 0) -
RECORDSIZE(250 250) -
FREESPACE(20 10) -
BUFFERSPACE(25000) ) -
INDEX -
(NAME(VWX.KSINDEX) -
CATALOG (RSTUCAT1)
/*

Define ESDS

Here you can use NONINDEXED parameter that tells the cluster in define relates to ESDS.

//DEFCLU2  JOB    ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE CLUSTER -
(NAME(VWX.EXAMPLE.KSDS1) -
MODEL(VWX.MYDATA) -
VOLUMES(VSER02))
DEFINE CLUSTER -
(NAME(KLM.EXAMPLE.ESDS1) -
RECORDS(100 500) -
RECORDSIZE(250 250) -
VOLUMES(VSER03) -
NONINDEXED )
/*

Define RRDS/VRRDS

Here you can use NUMBERED parameter that tells the cluster in define relates to RRDS. The IDCAMS define is same for both. The understand is, the slot allows both fixed and variable length records. So you can use the same definition.

//DEFCLU4  JOB   ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE CLUSTER -
(NAME(EXAMPLE.RRDS1) -
RECORDSIZE(100 100) -
VOLUMES(VSER01) -
TRACKS(10 5) -
NUMBERED) -
CATALOG(USERCAT)
/*

Define LDS

Here you can use LINEAR parameter that tells the cluster in define relates to LDS (Linear Sequential dataset).

//JNAME    JOB 'ALLOCATE LINEAR',MSGLEVEL=(1,1),
//         CLASS=R,MSGCLASS=D,USER=JOHNDOE
//*
//*        ALLOCATE A VSAM LINEAR DATASET
//*
//CLUSTPG  EXEC PGM=IDCAMS,REGION=4096K
//SYSPRINT DD SYSOUT=*
//DIVPAK   DD UNIT=3380,VOL=SER=DIVPAK,DISP=OLD
//SYSIN    DD *
           DEFINE CLUSTER (NAME(DIV.SAMPLE) -
                  VOLUMES(DIVPAK) -
                  TRACKS(1,1) -
                  SHAREOPTIONS(1,3) -
                  LINEAR)
/*

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Start Discussion

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.