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

Arne Vajhøj arne at vajhoej.dk
Wed Sep 20 20:07:43 EDT 2023


On 9/20/2023 12:23 PM, bill wrote:
> Funny thing about this.  I found very little about it in any of
> the (many) COBOL books I have.  I also don't remember ever having
> done it in a production program in my entire 40 year career.
> This kind of task was done much better with ISAM and today it
> would be database.

I don't think relative files has been big anywhere anytime.

But it is supported in the Cobol standard.

I don't see any point of relative files in newer times, but
I suspect that going sufficiently long time back there were
performance reasons to prefer relative over indexed/ISAM

A relative read is:

calculate byte offset = record number * record length
read record length bytes starting at byte offset from file

An indexed/ISAM read is:

read root page
search in root page and find next level index page
read index page
search in index page and find either next level index page or data page
...
read data page
find record in data page

Difference in both number of IO's and CPU usage.

Does it matter on a x86-86? Probably not.

Did it matter on Itanium and Alpha? Probably not.

Did it matter on VAX? Maybe in some cases.

Did it matter on PDP-11? Probably.

Did it matter on PDP-8? If stuff like this was even possible then I am 
pretty sure yes.

Arne




More information about the Info-vax mailing list