The relative byte address of a record is placed in fcd-reladdr-offset in the FCD (or fcd-reladdr-big if bit 4 of fcd-config-flags is set) by all File Handler operations that involve specific records. To use the relative byte address of a record, simply save the contents of this field after a READ operation.
Using the relative byte address is a fast method of accessing records, but has limitations of which you should be aware:
- A relative byte address operation does not affect the current record pointer. Therefore, a READ (sequential) after a relative byte address operation returns the record after the last one accessed using normal access methods. It does not return the record after the one you accessed using the relative byte address. It is possible, however, to update the current record pointer to point to the record you accessed using relative byte addressing by setting bit 5 of fcd-config-flags in the FCD before calling the File Handler to perform the relative byte address operation.
- Relative byte address operations update the index when a record is rewritten or deleted.
- If a record has been deleted since the relative byte address for it was obtained, a read or write using its relative byte address usually fails. However, it is possible for it to have been replaced by a different record and for this to go undetected.
Record locking is supported with relative byte address operations.
Once you have obtained the relative byte address of a record, you can use it to perform a number of operations.