Partition selection using a partition selection exit routine
If you need to select partitions by some criteria other than their high keys, you can use a partition selection exit routine.
IMS provides a sample HALDB Partition Selection exit routine (DFSPSE00), which assigns records to partitions based on the key of the root segment. The exit routine also determines the order in which sequential processing accesses the partitions. You can also write your own partition selection exit routine.
For a PHIDAM database, a partition selection exit routine can distribute the records in a key sequence within a partition that is out of sequence with the key sequences of the other partitions in the database. For example, a partition selection exit routine that uses the rightmost portion of a key to select the partition can conform to the characteristics of a HDAM database on data retrieval calls. Partition PARTA might include records in the following sequence: A001, B001, C001, D001. Partition PARTB might include records in this sequence: A010, B010, C010, D010. As in a HDAM database, a sequential retrieval call to find a segment with a key of C010 fails if partition PARTA is selected.
You can also use a partition selection exit routine to isolate certain database records by their characteristics. For example, if the sizes of most records in a PHDAM database are fairly uniform, except for a few records that are very large, the unusually large records can cause space usage problems within partitions. If the keys of the large records are known, an exit routine could recognize their keys and place them in a partition with different space characteristics. The partition might have many fewer records spread across the same amount of space or have its own specialized randomization routine.
The IBM® IMS HALDB Conversion and Maintenance Aid for z/OS® includes the IHCPSEL0 exit routine, which can perform this type of partition selection. If you use the IHCPSEL0 exit routine, you do not need to write an exit routine. You need only to specify the part of the key that is to be used and the values for each partition.
You can find more information about the IBM IMS HALDB Conversion and Maintenance Aid for z/OS on the IBM DB2® and IMS Tools website at www.ibm.com/software/data/db2imstools.