[Info-vax] Example of random access by record number on an RMS fixed record size, relative organization file?

Hein RMS van den Heuvel heinvandenheuvel at gmail.com
Wed Sep 20 22:37:31 EDT 2023


On Wednesday, September 20, 2023 at 8:07:47 PM UTC-4, Arne Vajhøj wrote:
:
> A relative read is: 
> 
> calculate byte offset = record number * record length 
> read record length bytes starting at byte offset from file 

Noop. 
Not for RMS. Not even for fixed length record sequential files.

Sequential files are conceptually divided into fixed length Multi Block Count (MBC) time 512 byte buffers.
For shared file access the first accessor locks in the MBC. Default MBC=16 = 8KB.
RMS will first take an integer round down to MBC to find the first MBC block to read and finds the record in there.
It may need a second read if the records spills over the end, even if it could have just started the read later.

For Relative files RMS divides the file up into buckets (default = big enough to hold 1 at least record.
It first calculates records/bucket (RPB) integer divide of bucketsize*512 and (one (flag byte) plus Maximum Record Size).
Next calculate VBN as 1 (File Prologue) plus integer divide of record number by RPB times RPB.
Read BKS * 512 bytes, and locate the record.
Hein.




More information about the Info-vax mailing list