Associative Access Method


 

Associative access method (AAM) files allow the user to process logical records based on `collective key' information. Similar to ISAM, these methods use a control file (AAM file) to determine which logical record is processed based upon the key information specified. Unlike ISAM, AAM does not require a complete or specific key. However, the key information must have been extracted from data written within the logical record.

Note the following:

  1. An attempt to retrieve a logical record using a key that has not been previously written to the AAM file will fail.

  2. If fixed length records are used, the buffer size 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) will be padded or truncated, as appropriate. In addition, deleted record space will automatically be re-used on AAM files with fixed record lengths.

  3. A physical text file may have more than one key file (AAM and/or ISI) 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.

  4. Up to 63 different key fields may be specified during an AAM file's creation. Each of the key fields may be up to 255 bytes long and they may be specified as being any of the data within the logical record.

  5. A search for matching logical records can be made using the following techniques:

  6. At least one non-null key specification is necessary for the first SA_AamRead operation since an AAM file has been opened. After this criteria has been met, subsequent SA_AamRead operations using all null key information will re-read the previously retrieved logical record.

  7. The same key field can be searched using more than one technique in an SA_AamRead operation (i.e., both a Left and a Free search or both a Right and Free, etc.).

  8. Upon successful retrieval of a record, subsequent records that also match the search criteria can be accessed using the SA_AamReadKG operation. After at least one successful SA_AamReadKG operation, the search can be resumed in reverse order (re-reading previously read records) using the SA_AamReadKGP operation.

  9. Logical records may be updated in place (key information is automatically updated).

  10. The AAM key file requires 64K for every 2048 logical records in the physical text file.

  11.  



Sunaccess Reference Index Sequential Access Method File Accessing Modes