The top 7 IDCAMS commands need for VSAM

The IDCAMS utility command- with this you can manipulate VSAM datasets. The below is the popular list that you need to work with VSAM. Try available jobs in this field.

The following are the different applications of IDCAMS utility in mainframe. This is applicable for both VSAM and non-VSAM datasets.

ALTER – The Alter modifies a catalog, alternative index, cluster and path.

Example to use ALTER

//ALTERE  EXEC PGM=IDCAMS,REGION=4M                          
//SYSPRINT DD   SYSOUT=A                                      
//SYSIN    DD   *                                             
      ALTER CICS.* -                                          
         NEWNAME(CICSA.*)                                      
/*     

BLDINDEX– builds alternate index.

Example to use BLDINDEX

//BUILDX1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTWK01 DD SPACE=(CYL,(50,50))
//SORTWK02 DD SPACE=(CYL,(50,50))
//SYSIN DD *
 BLDINDEX IDS(VSAMAIX.BIX.ESDS) ODS(VSAMAIX.BIX.AIX) SORTMESSAGELEVEL(ALL)
/* 

DEFINE– for alternate index, cluster or path.

Example to define ALTINDEX

//DEFAIX1  JOB   ...
//STEP1    EXEC  PGM=IDCAMS
//SYSPRINT DD    SYSOUT=A
//SYSIN    DD    *
     DEFINE ALTERNATEINDEX -
           (NAME(EXAMPLE.AIX) -
           RELATE(EXAMPLE.KSDS2) -
           KEYS(3 0) -
           RECORDSIZE(40 50) -
           VOLUMES(VSER01) -
           CYLINDERS(3 1) -
           NONUNIQUEKEY -
           UPGRADE) -
         CATALOG(USERCAT)
/*

LISTCAT – lists information about dataset. LISTCAT to list the aliases associated with a catalog.

//LSTALIAS EXEC PGM=IDCAMS
 //SYSPRINT DD SYSOUT=A
 //SYSIN    DD *
     LISTCAT ALL ENTRIES(SYS1.ICFCAT.VSYS303)
 /*

PRINT- prints contents.

REPRO– copies records from one dataset to other dataset.

DELETE– removes catalog entry for catalog, cluster, alternate index, or path.

Example for PRINT, REPRO and DELETE

//SYSIN DD *
DEF CL(NAME(VSAMAIX.BIX.ESDS) TRACKS(10 5) RECSZ(8 8) NIXD NRUS)
 IF MAXCC > 0 THEN CANCEL ;
REPRO IDS(VSAMAIX.BIX.FLAT) ODS(VSAMAIX.BIX.ESDS)
 IF MAXCC > 0 THEN CANCEL ;
DEF AIX(NAME(VSAMAIX.BIX.AIX) REL(VSAMAIX.BIX.ESDS) -
 RECSZ(4086 240000) KEYS(3 4) TRACKS(5 5) NUNQK)
 IF MAXCC > 0 THEN CANCEL ;
BLDINDEX IDS(VSAMAIX.BIX.ESDS) ODS(VSAMAIX.BIX.AIX) NOSORTCALL
 IF MAXCC > 4 THEN CANCEL ;
LISTC ENT(VSAMAIX.BIX.ESDS VSAMAIX.BIX.AIX ) ALL
PRINT IDS(VSAMAIX.BIX.ESDS) DUMP COUNT(20)
PRINT IDS(VSAMAIX.BIX.AIX) DUMP
DELETE VSAMAIX.BIX.*
/*
Advertisements

Author: Srini

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