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.

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
You must be logged in to post a comment.