JCL for VSAM alternate index cluster with explanation

VSAM alternate index is built by IDCAM BLDINDEX perameter.

In the below JCL the IDS is ESDS base cluster. The ODS is Alternate index.

//BIX1 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)

/*

Note: IDCAMS allocates the SYSOUT and SORTWKxx data sets dynamically if they’re not present in the JCL.

SORTMESSAGELEVEL(ALL) ==> Specifying SORTMESSAGELEVEL(ALL) ensures all of the SORT messages are written to SYSOUT

Alternate way you can write JCL as follows:

//BUFSP EXEC PGM=IDCAMS
//ESDS  DD DSN=VSAMAIX.BIX.ESDS,DISP=SHR,AMP='BUFSP=500000'
//AIX   DD DSN=VSAMAIX.BIX.AIX,DISP=SHR,AMP='BUFSP=500000'
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTWK01 DD SPACE=(CYL,(50,50))
//SORTWK02 DD SPACE=(CYL,(50,50))
//SYSIN    DD *
 BLDINDEX IFILE(ESDS) OFILE(AIX) SORTML(ALL)

Author: Srini

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