Using key ranges to partition


The data portion of HIDAM is partitioned using a key range defined by a HIGHKEY in each partition. The range of keys uses EBCDIC collating sequence, so lowercase precedes uppercase, and numbers follow uppercase letters.

Any key lower than the HIGHKEY of the first partition is stored in the first partition. The opposite is true of the last partition, the HIGHKEY in the last partition is a hex ‘FF’ key, so all keys higher than the HIGHKEY in the second to the last partition are stored in the last partition.

Although a character key can be lowercase, uppercase and numbers, the key ranges used must account for the sequence of lowercase, uppercase, then numbers.

Non-character keys can also be used by defining the HIGHKEY in hexadecimal format. The most common non-character key used in HIDAM is packed decimal. A packed decimal +999 can be represented as '999C' in hexadecimal. Because the sign is on the right in packed decimal format, negative and positive packed decimal numbers will be in the same partition.

Partitioning HIDAM

image2018-12-19_17-13-3.png

The HIGHKEY is inserted by DL/1 and always ends in at least one hexadecimal ‘FF’ to ensure it is not a valid character or packed decimal key. DL/1 will pad the HIGHKEY with hex ‘FF’s, so it is the highest possible key value in the partition. The last partition HIGHKEY is all hexadecimal ‘FF’s.

HIGHKEY in Index and Each Partition

image2018-12-19_17-15-26.png

DL/1 already inserts a hexadecimal ‘FF’ key in HIDAM for a HIGHKEY that is used for HIDAM twin backwards pointers. The HIGHKEY for each partition is used for the same purpose.

The application cannot insert a HIGHKEY in HIDAM; during load, the application receives an LB status code if it attempts to load a HIGHKEY. The application will receive an II status code if it attempts to insert a HIGHKEY because it already exists. The application will receive a GE status code if it attempts to retrieve the HIGHKEY with a get unique. The HIGHKEY is skipped over for get next calls, and not returned to the application.

This section contains following topics:


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*