[Info-vax] Example of random access by record number on an RMS fixed record size, relative organization file?
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Sep 20 08:22:49 EDT 2023
On 2023-09-20, Arne Vajhøj <arne at vajhoej.dk> wrote:
> On 9/19/2023 11:15 PM, gah4 wrote:
>> On Tuesday, September 19, 2023 at 5:46:29?PM UTC-7, Arne Vajhøj wrote:
>>> open(unit=1,file='rel.dat',status='new',form='formatted',
>>> + organization='relative',recl=512,recordtype='variable',
>>> + access='direct')
>>
>> OP asked about fixed record size, and traditionally that is
>> the way it was done. I haven't followed that detail of later
>> Fortran standards. They have to, at least, allocate to the
>> maximum size.
>
> True.
>
> I added a little more for my example.
>
> If I understand the docs correctly then the above
> allocates 512 bytes (per recl) for each cell, but
> handles actual lengths 0-512 within that cell.
>
It allocates 512 bytes for the _data_ within that cell. It then allocates
a bit more per record to store the length of each record. Look at the
example Hein posted.
$ set response/mode=good_natured
Even without your statement about never having used relative files,
at this point I would be actively suspecting that to be the case. :-)
I _have_ used relative files in the past in a number of cases, but I have
never, ever, used anything other than fixed length records with them.
The idea of variable length records within a relative file is utterly
alien to me.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
More information about the Info-vax
mailing list