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 ISRT algorithm attempts to put the entire database record close to the root segment (with the exception of SDEP segments). No BYTES parameter exists to limit the size of the record portion to be inserted in the root addressable part.
- With the DEDB, only one RAP can be defined in each root addressable CI.
- CIs that are not randomized to are left empty.
The standard randomizer randomly distributes database records across the entire database. A two-stage or one-stage randomizer can be defined with the RMNAME parameter.
For a DEDB database with more than one area, a two-stage randomizer selects a specific area and the RAP within that area as the target for that database record. For a DEDB with a single area, a two-stage or a one-stage randomizer simply selects the RAP within that one area as the target for the database record.
To change the UOW or RAP parameters for a specific area in a DEDB database that includes more than one area using online change without affecting other areas in the DEDB, a two-stage randomizer must be used. For a DEDB database with only one area, either a one-stage or two-stage randomizer can be used.
To alter a DEDB database that includes more than one area using the DEDB Alter utility (DBFUDA00), a two-stage randomizing routine must be used. To alter a DEDB database with a single area using the DEDB Alter utility, either a one-stage or two-stage randomizing routine can be used.
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).