Running the Build Index function

By running the Build Index function, you can build secondary index databases from the DEDB database. FPA runs the Build Index function as a standard z/OS® batch job. You must specify an EXEC statement and DD statements that define the input and output data sets in your JCL.

Procedure

  1. Optional: Estimate the region size that is required to run the job.
  2. Specify the EXEC statement in the following format:
    //INDEXBLD  EXEC PGM=HFPMAIN0,REGION=rrrrM,
    //          PARM='DBRCGRP=dbrcgrp,GSGNAME=gsgname,IMSPLEX=imsplex'
    Parameter Description
    DBRCGRP= DBRCGRP is an optional 1- to 3-character parameter that specifies the identifier assigned to a group of DBRC instances (DBRC sharing group) that access the same RECON data set in the IMSplex.
    GSGNAME= GSGNAME is an optional 1- to 8-character parameter that specifies the global service group.
    IMSPLEX= IMSPLEX is an optional 1- to 5-character parameter that specifies the IMSplex group names to share either databases or message queues.
  3. Specify the DD statements to define input data sets and output data sets.

    For descriptions of the DD statements, see DD statements for the Build Index function.

    To build secondary indexes by running two Build Index jobs (one in scan mode and another in load mode), you must supply information about build pointer segment record data sets. You can do so by specifying DD statements (S0nnnnn0 DD) or utility control statements.

  4. Specify the utility control statements.
    1. Specify the INDEXBLD command.
    2. Specify the database name on the DBD keyword.
    3. Either specify IDXPROC=BUILD, or specify no IDXPROC keyword.

      The IDXPROC keyword must specify BUILD to build secondary index databases. The default parameter for the IDXPROC keyword is BUILD.

    4. Specify the runtime mode on the BUILDMODE keyword. You can specify one of the following parameters:
      SCANLOAD
      The job runs in scan load mode. It scans the DEDB areas and builds secondary index databases in one job step. BUILDMODE=SCANLOAD is the default.
      SCAN
      The job runs in scan mode. It scans the DEDB areas and then generates build pointer segment records. You must later run the job in load mode to build secondary index databases.
      LOAD
      The job runs in load mode. It reads the records from the build pointer segment record data sets and loads index pointer segments into the secondary index databases.
      Considerations for selecting a mode: Running the job in scan load mode is the easiest method to build secondary index databases. However, in scan load mode, DFSORT is internally used during the job to sort the records in build pointer segment record data sets. If you want to use a different sort program, you can run the job in scan mode, sort the records manually by using your desired sort program, and then run the job in load mode.

    See Utility control statements for the Build Index function and specify other command, subcommands, and keywords.

  5. Run the JCL job.
  6. If you run the job in scan mode, update the statements or create another JCL job to run in load mode. Then, run that job to load the secondary index databases.
    In load mode, if you specify SORT=YES, the sort is done during the job before the pointer segments are loaded (SORT=YES is the default). If you specify SORT=NO, sort is not done in the job. In this case, you must manually sort the build pointer segment records before you run the job in load mode.
    Tips for manually sorting the records:
    • Secondary Index Processing report, which is generated in step 5, contains auto-generated sort control statements for DFSORT. You can copy and paste the control statements into a DFSORT job to sort the records with DFSORT.
    • To sort the records manually, use the first column as the starting position of the sort field, and "key_length + 1" as the length of the sort field.

Example

The following figure shows a JCL example for the INDEXBLD command for building secondary index databases in scan load mode.

Figure 1. JCL example for the INDEXBLD command for building secondary index databases (scan load mode)
//**************************************
//**  BUILDING SECONDARY INDEX DB(S)  **
//**************************************
//INDEXBLD EXEC PGM=HFPMAIN0
//*
//STEPLIB  DD DISP=SHR,DSN=HPFP.SHFPLMD0
//         DD DISP=SHR,DSN=IMSVS.SDFSRESL
//IMSACB   DD DISP=SHR,DSN=IMSVS.FPSI.ACBLIB
//HFPPRINT DD SYSOUT=A
//HFPRPTS  DD SYSOUT=A
//*
//HFPSYSIN DD *
  GLOBAL DBRC=NO
  INDEXBLD
      DBD=IVPDB3
/*
//DFSIVD3A  DD DISP=OLD,DSN=IMSVS.DFSIVD31
//DFSIVD3B  DD DISP=OLD,DSN=IMSVS.DFSIVD33
//SINDEXA   DD DISP=OLD,DSN=IMSVS.SINDEXA
//SINDEXB   DD DISP=OLD,DSN=IMSVS.SINDEXB
//*