DFSDHDS0

Load module DFSDHDS0 contains the programs necessary to perform IMS database space management. Source for this module is found in DBSOURCE members DFSDHD00 and DFSRRHM0. This process manages the free and allocated space within a DL/I database.

The DL/I space manager is invoked whenever an IMS insert, replace, or delete call will alter the use of space within a DL/I database. DFSDHDSO is also invoked when space changes as a result of database backout or IMS emergency restart.

CSECT DFSDHDS0, in module DFSDHD00, is the entry point for the DL/I space manager. This module analyzes the space request and calls one of 3 main processing routines:

·   DFSGGSPC - gets space

·   DFSFRSPC - frees space

·   DFSRCHBK - gets space during backout

If necessary, this module will retrieve the physical database block. It will also value fields in the data management block (DMB), which describes the physical database, before calling the routines.

Hints

The amount of work that the DL/I space manager has to do on your behalf can be reduced by using good database design techniques.

For volatile databases, allocate adequate free space.

The DL/I space manager uses a multiple step algorithm to find freespace. This is documented in the description for module DFSGGSPC. At several points in the process, the entire buffer pool will be searched for a block with appropriate freespace. For jobs that do a lot of sequential inserting, a smaller buffer pool can be more efficient than a larger one. If a large buffer pool is required for other databases in the job, dedicate buffers to the database with all the inserts, and allocate only as many buffers as are needed.

Inefficient use of variable length segments can also cause unnecessary processing by the DL/I space manager. If a replaced variable length segment is even one byte larger than when it was retrieved, space management will be invoked. If there is extra space just beyond where the segment was, the segment can go back to its original spot, but the freespace left beyond the segment must be adjusted.

If there is not sufficient space to replace the segment in its original position, the prefix will be left in the original position, the original data portion will now become freespace, and the new data portion will have to be inserted elsewhere, which also requires space management. Now when the segment is retrieved, IMS will have to look in two places, and might need to do an extra I/O. By using a minimum length for variable length segments and padding smaller segments to that length, a little bit of extra space will be used, but a great deal of performance will be gained.

Finally, excessive CPU in the space management routines might be a sign that a database reorganization is required.

Reference Sources

More information on modules DFSDHD00 and DFSRRHM0 is available in the IMS DBSOURCE Library DataSet. See your IMS systems programmer.