Indexed Sequential Access Method


 

Indexed sequential access method (ISAM) files use a `key file' (ISI file) to determine which logical record in the physical text file is associated with the `key data' supplied. The ISI file acts as the control file for the processing of logical records within the physical text file. The `key data' is usually built from actual data within the logical record that is processed. However, the `key data' does not have to come from the logical record for ISAM processing.

Note the following:

  1. An ISAM file may permit or disallow duplicate keys within the ISI control file. If duplicate ISAM keys are not allowed, each logical record in the physical text file must have a unique ISAM key pointing to it. If duplicate ISAM keys are allowed, caution must be taken to insure the correct record is being processed, since the same key information may be duplicated and reference a different logical record in the physical text file.

  2. A physical text file that has an associated ISI key file may be read physically sequential or random, key sequentially (forward or backwards) or through a specific key. However, logical records may only be written, updated or deleted in the physical text file through use of a specific key.

  3. An attempt to retrieve a logical record using a key that has not been previously written to the ISI file fails and positions the ISI file pointer to where the key information would have been placed had it been written. The OVER Condition Flag is set to TRUE.

  4. If fixed length records are used, the sector size (as defined using the BUFFER/FIX/FIXED declaration parameter) must be equal to or greater than the declared fixed record length. Any records written that are other than the declared fixed record length size (shorter or longer) is padded (with the LESS Condition Flag set TRUE if record locking is not in effect) or truncated (with the OVER Condition Flag set TRUE), as appropriate. In addition, deleted record space is automatically re-used on ISAM files with fixed record lengths.

  5. A physical text file may have more than one key file (ISAM and/or AAM) associated with it. However, caution should be exercised when processing physical text files with more than one key file associated with it to insure adjustments are made to each affected key file when any processing is performed. Users are encouraged to explore the FILELIST data item to simplify coding of multiple index data files and to prevent common coding mistakes.

  6. The ISAM key information is placed into the ISI control file based on the standard ASCII collating sequence. The index method is a full B-tree structure supporting a maximum key size of 150 bytes and a maximum record length of 64 KB minus one.

 

 

See Also: Sequential Access Method, Random Access Method, Associative Access Method, Disk I/O Instructions

 



PL/B Language Reference Random Access Method Associative Access Method