Using algorithms instead of indexing
This method of reducing I/O is especially useful where some parts of a file are more frequently accessed than others. For example, it may not be efficient to index every date in a flight file when only the earlier dates are being accessed frequently.
You can code a mathematical function to translate the index key (for example, date) and then use z/TPFDF algorithm #TPFDB05 to locate the ordinal directly. Alternatively, you could use the z/TPFDF user exit in segment ubd0.asm to define an algorithm of your own. See Create your own algorithm for more information about creating user-defined algorithms.


The distribution will probably be very uneven if you use algorithms #TPFDB01, #TPFDB02, or #TPFDB03. However, if you define your own algorithm, you can accommodate this difficulty by creating extra ordinals for the more common characters. See Create your own algorithm for more information about user-defined algorithms.