Example flow for HD databases with logical relationships or secondary indexes

If your HD database has logical relationships or secondary indexes or if you are making additional structural changes to your database when adding multiple data set groups, you will follow a process similar to that shown in the following figure.

The following figure illustrates the process flow for modifying a database that uses logical relationships or secondary indexes to use multiple data set groups.

Figure 1. Flow chart of process for modifying a database with logical relationships or secondary indexes to use multiple data set groups
In addition to the steps shown in the flow for simple databases, if logical relationships exist, the DFSURPR0 utility is run after the DBDGEN before database scan or reload. If work data sets are generated, DFSURG10 utility is run. If secondary indexes exist, DFSURUL0 and DFSURRL0 utilities are run. If logical relationships exist, DFSURPG0 utility is run. End of flow.

Notes to the preceding flow chart:

  1. If one or more segments in any or all of the databases being operated upon is involved in either a logical relationship or a secondary index relationship, the YES branch must be taken. You can also use the Prereorganization utility to determine which database operations must be performed.
  2. Based upon the information given to it on control statements, the database Prereorganization utility provides a list of databases that must be initially loaded, reorganized, or scanned. You must not change the number and sequence of databases specified on the prereorganization control statement between reload and prefix resolution.
  3. You must run the DB Scan utility before a database is unloaded when logical parent concatenated keys are defined as virtual in the logical child database to be unloaded.

    This program should be executed against each database listed in the output of the Prereorganization utility. A work data set can be generated for each database scanned by this utility. Databases for scanning are listed after the characters DBS= in one or more output messages of the Prereorganization utility.

  4. The HD Reorganization Reload utility can cause the generation of a work data set to be later used by the Database Prefix Resolution utility. Databases to be reorganized using the HD Reorganization Unload utility and the HD Reorganization Reload utility are listed after the character DBR= in one or more output messages of the Prereorganization utility.
  5. The user-provided initial database load program can automatically cause the generation of a work data set to be later used by the Prefix Resolution utility. You do not need to add code to the initial load program for work data set generation. Code is added automatically by IMS through the user program issuing ISRT requests. You must, however, provide a DD statement for this data set along with the other JCL statements necessary to execute the initial load program. Databases for initial loading are listed after the characters DBIL= in one or more output messages of the Prereorganization utility.
  6. You must ensure that all operations indicated by the Prereorganization utility (if it was executed) are completed prior to taking the YES branch.
  7. If any work data sets were generated during any of the database operations that were executed by you, the YES branch must be taken. The presence of a logical relationship in a database does not guarantee that work data sets will be generated during a database operation. The reorganization/load processing utilities determine the need for work data sets dynamically, based upon the actual segments presented during a database operation. If any segments that participate in a logical relationship are loaded, work data sets will be generated and the YES branch must be taken.

    If for any specific database operation no work data set was generated for the database, processing of that database is complete and ready to use.

    When a HIDAM database is initially loaded or reorganized, its primary index will be generated at database load time.

  8. The Database Prefix Resolution utility combines the work file output from the Database Scan utility and either the HD Reorganization Reload utility or the user's initial database load execution, but not both, to create an output data set, DFSURWF3, for use by the Prefix Update utility. The Prefix Update utility then completes all logical relationships defined for the databases that were operated upon.
  9. If a secondary index needs to be created or if two secondary indexes need to be combined, you must run the HISAM Unload/Reload utilities. After the HISAM Unload/Reload utilities are run, if logical relationships exist in the database, you must execute the Prefix Update utility before the reorganization or load process is considered to be complete.
  10. This area of the flowchart must be followed once for each database to be operated upon, whether the operation consists of an initial load, reorganization, or scan. The operations can be done for all databases concurrently, or one database at a time. If the various database operations are performed sequentially, work data set storage space can be saved and processing efficiency increased if DISP=(MOD,KEEP) is specified for the DFSURWF1 DD statement associated with each database operation. The attributes of the work data set for the database initial load, reorganization, and scan programs must be identical.

    When using the HD Reorganization Reload utility, first do all unloads and scans of logically related databases if logical parent concatenated keys are defined as virtual in the logical child.