IDCAMS Utility
• IDCAMS Utility is very useful utility to manipulate VSAM datasets 1. IDCAMS - Allocating a VSAM dataset • The following example illustrates the usage of IDCAMS for the allocation of VSAM. //JCLWORLD JOB NOTIFY=JCLUSR7 //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(JCLWORLD.JCL.VSAM) BUFFERSPACE(52525) - INDEXED KEYS(5 0) RECORDSIZE(80 80) ) - DATA(NAME(JCLWORLD.JCL.VSAM.DATA) - TRACKS(3 3) CONTROLINTERVALSIZE(18432)) - INDEX(NAME(JCLWORLD.JCL.VSAM.INDEX) - TRACKS(2 2) CONTROLINTERVALSIZE(512)) /* • Below are the description of parameters used in above examples. NAME – specifies the name of the cluster (VSAM dataset) BUFFERSPACE – specifies the size of the buffer INDEXED / NON-INDEXED / NUMBERED / LINEAR – specifies to create KSDS / ESDS / RRDS / LDS respectively KEYS – specifies the key size and offset (For KSDS only) RECORDSIZE – specifies the average & maximum record size (not for LDS) DATA – specifies the parameters like NAME, TRACKS, CISIZE etc. for the DATA component INDEX – specifies the parameters like NAME, TRACKS, CISIZE etc. for the INDEX component (for KSDS only) 2. IDCAMS – Loading Data Into VSAM • The following example illustrates the usage of IDCAMS for loading data into VSAM //JCLWORLD JOB NOTIFY=JCLUSR7 //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * REPRO - IDS(‘JCLWORLD.JCL.VSAM') - ODS(‘JCLWORLD.JCL.VSAM2') /* • The REPRO command is used to copy the contents of one dataset to another dataset. The datasets can be either a VSAM or a Non-VSAM. • Some of important parameters of REPRO command are as follows: IDS – specifies the Input dataset name ODS – specifies the Output dataset name INFILE – specifies the ddname of the Input dataset OUTFILE – specifies the ddname of the Output dataset 3. IDCAMS – Deleting a VSAM dataset • The following example illustrates the usage of IDCAMS for deleting a VSAM. //JCLWORLD JOB NOTIFY=JCLUSR7 //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE - JCLWORLD.JCL.VSAM - CLUSTER /* |