Accessing segments
When accessing a segment in a HISAM database, the application program follows a set search sequence.
In HISAM, when an application program issues a call with a segment search argument (SSA) qualified on the key of the root segment, the segment is found by:
- Searching the index for the first pointer with a value greater than or equal to the specified root key (the index points to the highest root key in each CI)
- Following the index pointer to the correct CI
- Searching this CI for the correct logical record (the root key value is compared with each root key in the CI)
- When the correct logical record (and therefore database record) is found, searching sequentially through it for the specified segment
If an application program issues a GU call with an unqualified SSA for a root segment or with an SSA qualified on other than the root key, the HISAM index cannot be used. The search for the segment starts at the beginning of the database and proceeds sequentially until the specified segment is found.