How to Write VSAM Cluster Sample JCL

VSAM alternate index is built by IDCAM BLDINDEX parameter. In the below JCL the IDS is ESDS base cluster. The ODS is Alternate index.

Sample VSAM Cluster

//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) , it ensures all of the SORT messages are written to SYSOUT.

How to Write VSAM Cluster Alternative Way

//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.