[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
Thu Sep 21 21:12:28 EDT 2023
On 9/21/2023 9:05 PM, Dave Froble wrote:
> On 9/21/2023 8:39 PM, Arne Vajhøj wrote:
>> On 9/20/2023 7:15 AM, Arne Vajhøj wrote:
>>> On 9/20/2023 12:02 AM, Dave Froble wrote:
>>>> On 9/19/2023 8:50 PM, Arne Vajhøj wrote:
>>>>> On 9/19/2023 8:44 PM, Arne Vajhøj wrote:
>>>>>> On 9/16/2023 4:16 PM, Arne Vajhøj wrote:
>>>>>>> I don't think I have ever used ORG=REL.
>>>>>>
>>>>>> But then I could start now!
>>>>>
>>>>> C / RMS:
>>>>
>>>> Is it just me, or, was my Basic example shorter and easier to read
>>>> than your
>>>> Cobol, Fortran, and C examples?
>>>
>>> The Basic code was a bit shorter than the Fortran and Pascal code.
>>> No so surprising VMS Basic is pretty good in expressing logic
>>> in few lines.
>>>
>>> The Basic code was a lot shorter than the C code, because
>>> that was using RMS calls and not language specific statement -
>>> working with RMS Calls and FAB & RAB blocks always require
>>> way more code than language specific statements.
>>
>> The stats for my code:
>>
>> Fortran: 13 + 11 + 12 = 36
>> Basic: 13 + 16 + 13 = 42
>> Pascal: 23 + 22 + 22 = 67
>> Cobol: 32 + 28 + 29 = 89
>> Macro-32: 34 + 38 + 43 = 115
>> C: 57 + 55 + 57 = 169
>>
>> Obviously the result depends a little on coding style - and
>> mine is just mine.
>
> What are those stats?
For each language I did 3 programs:
* write
* read sequential
* read by record number
The numbers are lines.
> I believe my example both created and populated the file, then allowed
> the user to select and display records. 14 lines of code, if I counted
> correctly.
>
> If we're looking for minimum code ...
So my Basic examples were 13, 16 and 13 lines.
I think the main difference are that I had program statement at top,
declared variables instead of using type suffix and looped over
all records when reading.
And then maybe that I know little about VMS Basic.
BTW, my basic code has a difference from the other languages as
I was not able to put leading zeroes in the 4 digits line number.
How does one get an integer formatted to a given width with leading
zeros in VMS basic??
Arne
More information about the Info-vax
mailing list