DEDB randomizing routine design

A DEDB randomizing module is required for placing root segments in a DEDB and for retrieving root segments from a DEDB.

One or more such modules can be used with an IMS system. Only one randomizing module can be associated with each DEDB.

The purpose of the randomizing module is the same as in HDAM processing. A root search argument key field value is supplied by the application program and converted into a relative root anchor point number. Because the entry and exit interfaces are different, DEDB and HDAM randomizing routines are not object code compatible. The main line randomizing logic of HDAM should not need modification if randomizing through the whole DEDB.

Some additional differences between DEDB and HDAM randomizing routines are as follows:

The standard randomizer randomly distributes database records across the entire database. A two-stage randomizer is defined with the RMNAME parameter. The two-stage randomizer selects the specific area and the RAP within that area as the target for that database record. Use the two-stage randomizer to change the UOW or RAP parameters for a specific area using online change, and without affecting other areas in the DEDB. To alter a DEDB database or area by using the DEDB Alter utility, a two-stage randomizing routine is required.

Recommendation: Use a two-stage randomizing routine.

Because of the area concept, some applications might randomize in a particular area rather than through all the DEDBs, as in HDAM processing. Therefore, the expected output of such a randomizing module is made up of a relative root anchor point number in an area and the address of the control block (DMAC) representing the area selected.

Keys that randomize to the same RAP are chained in ascending key sequence.

DEDB logic runs in parallel, so DEDB randomizing routines must be reentrant. The randomizing routines operate out of the common storage area (CSA). If they use operating system services like LOAD, DELETE, GETMAIN, and FREEMAIN, the routines must follow the same rules as described in IMS Version 15.2 Exit Routines.

DEDB randomizing routines are stored in ECSA storage and are usually unloaded from storage when access to the DEDB is stopped by issuing either the type-1 command /DBRECOVERY DB or the type-2 command UPDATE DB STOP(ACCESS). You can stop access to the DEDB without unloading the DEDB randomizer by using the NORAND parameter of the type-2 command UPDATE DB STOP(ACCESS).