IDCAMS Build Index for AIX Example


Scenario - Build index for alternate index on the employee KSDS file.

Input KSDS File - MATEPK.EMPL.KSDS

Input Alternate Index - MATEPK.EMPL.DEPTAIX

Input Path - MATEPK.EMPL.DEPTAIX.PATH

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKP JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID 
//********************************************
//* BUILD INDEX
//********************************************
//STEP10   EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  BLDINDEX - 
        INDATASET (MATEPK.EMPL.KSDS) - 
        OUTDATASET(MATEPK.EMPL.DEPTAIX) - 
		INTERNALSORT -
        NOSORTCALL
/*

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, then BLDINDEX is successful.

BUILD AIX Sysprint

Verify the loaded AIX in 3.4 (Dataset List utility) or any File management tools for the existance. AIX keys should load with the combination of the primary keys, as shown below -

Verify AIX Data

Explaining Example -

In the above example,

  • INDATASET (MATEPK.EMPL.KSDS) specifies the base cluster (employee KSDS).
  • OUTDATASET(MATEPK.EMPL.DEPTAIX) specifies the alternate index defined earlier.
  • NOSORTCALL specifies no call to DFSORT.