Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I'm not sure whether that's actually useful... -- Larry Wall in <199710011704.KAA21395@wall.org>


computers / comp.os.vms / Example of random access by record number on an RMS fixed record size, relative organization file?

SubjectAuthor
* Example of random access by record number on an RMS fixed record size, relative T. Kurt Bond
+* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
|`* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| +* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |`* Re: Example of random access by record number on an RMS fixed recordgah4
| | +* Re: Example of random access by record number on an RMS fixed recordHein RMS van den Heuvel
| | |+- Re: Example of random access by record number on an RMS fixed recordgah4
| | |`* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | | `* Re: Example of random access by record number on an RMS fixed recordHein RMS van den Heuvel
| | |  `- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | +* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |`* Re: Example of random access by record number on an RMS fixed record size, relatSimon Clubley
| | | +- Re: Example of random access by record number on an RMS fixed recordgah4
| | | `* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |  `* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |   `- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | `* Re: Example of random access by record number on an RMS fixed recordbill
| |  `* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |   +* Re: Example of random access by record number on an RMS fixed recordHein RMS van den Heuvel
| |   |+- Re: Example of random access by record number on an RMS fixed recordgah4
| |   |`- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |   `* Re: Example of random access by record number on an RMS fixed recordbill
| |    +* Re: Example of random access by record number on an RMS fixed recordgah4
| |    |+* Re: Example of random access by record number on an RMS fixed recordDave Froble
| |    ||`* Re: Example of random access by record number on an RMS fixed recordgah4
| |    || `* Re: Example of random access by record number on an RMS fixed recordDavid Jones
| |    ||  `* Re: Example of random access by record number on an RMS fixed recordgah4
| |    ||   `- Re: Example of random access by record number on an RMS fixed recordJohnny Billquist
| |    |`* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |    | +- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |    | `- Re: Example of random access by record number on an RMS fixed recordgah4
| |    `- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| +- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| +* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |`* Re: Example of random access by record number on an RMS fixed recordDave Froble
| | +* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |`* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | | `* Re: Example of random access by record number on an RMS fixed recordDave Froble
| | |  `* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |   +- Re: Example of random access by record number on an RMS fixed recordgah4
| | |   +* Re: Example of random access by record number on an RMS fixed recordJohnny Billquist
| | |   |`- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | |   `* Re: Example of random access by record number on an RMS fixed recordDave Froble
| | |    `- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| | `* Re: Example of random access by record number on an RMS fixed record size, relatSimon Clubley
| |  +- Re: Example of random access by record number on an RMS fixed recordHein RMS van den Heuvel
| |  `* Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| |   `* Re: Example of random access by record number on an RMS fixed record size, relatSimon Clubley
| |    +* Re: Example of random access by record number on an RMS fixed recordChris Townley
| |    |`- Re: Example of random access by record number on an RMS fixed record size, relatSimon Clubley
| |    `- Re: Example of random access by record number on an RMS fixed recordDave Froble
| +- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| +- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
| `- Re: Example of random access by record number on an RMS fixed recordArne Vajhøj
+- Re: Example of random access by record number on an RMS fixed recordDave Froble
+* Re: Example of random access by record number on an RMS fixed record size, relatBob Gezelter
|`- Re: Example of random access by record number on an RMS fixed recordgah4
+- Re: Example of random access by record number on an RMS fixed record size, relatNeil Rieck
+* Re: Example of random access by record number on an RMS fixed record size, relatT. Kurt Bond
|`* Re: Example of random access by record number on an RMS fixed record size, relatDennis Boone
| `- Re: Example of random access by record number on an RMS fixed recordbill
`- Re: Example of random access by record number on an RMS fixed record size, relatBrian Schenkenberger

Pages:123
Example of random access by record number on an RMS fixed record size, relative organization file?

<m25y49uca2.fsf@gmail.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29993&group=comp.os.vms#29993

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tkurtb...@gmail.com (T. Kurt Bond)
Newsgroups: comp.os.vms
Subject: Example of random access by record number on an RMS fixed record size, relative organization file?
Date: Sat, 16 Sep 2023 15:51:49 -0400
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <m25y49uca2.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="36c7314f9695f9a627a852560087438a";
logging-data="4174401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BDmdKxEiohzXukNQlOYABoTTgDmSioNQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
Cancel-Lock: sha1:LVG11StHkYxMe17qa1z0gK8fT9g=
sha1:a3nfF3DhrBd8E0mqQ50E8u3FOU4=
 by: T. Kurt Bond - Sat, 16 Sep 2023 19:51 UTC

Does anybody have an example program that uses random access by record
number on an RMS fixed record size, relative organization file they'd be
willing to share? I'm missing something, probably something obvious,
but I've not been able to get random access by record number to work.
I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
example in any language.

--
T. Kurt Bond, tkurtbond@gmail.com, tkurtbond.github.io, consp.org, & tkb.tx0.org

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ue52ev$3vimm$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29994&group=comp.os.vms#29994

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Sat, 16 Sep 2023 16:16:31 -0400
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <ue52ev$3vimm$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Sep 2023 20:16:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="000319d3170a97eed8e014f88c1115a5";
logging-data="4180694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UAW/f2kw8FXnvmoadwwZJRMJWpVuKEFg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7bOxLXaFnAOdm0fXpIm5CMzwBIo=
Content-Language: en-US
In-Reply-To: <m25y49uca2.fsf@gmail.com>
 by: Arne Vajhøj - Sat, 16 Sep 2023 20:16 UTC

On 9/16/2023 3:51 PM, T. Kurt Bond wrote:
> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.

So:
* RMS API (SYS$OPEN, SYS$GET, SYS$CLOSE)
* ORG=REL
* access by record number
?

I don't think I have ever used ORG=REL.

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ue5htm$2d24$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29995&group=comp.os.vms#29995

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Sat, 16 Sep 2023 20:40:16 -0400
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <ue5htm$2d24$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 17 Sep 2023 00:40:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7a18d776aa323530991001300ee136c1";
logging-data="78916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GJjvp7Hd3Qjxpgf9FP0fBha3KeXhAy70="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:SJHRh57tMdXdSjbJeIkh7TGlGVU=
In-Reply-To: <m25y49uca2.fsf@gmail.com>
 by: Dave Froble - Sun, 17 Sep 2023 00:40 UTC

On 9/16/2023 3:51 PM, T. Kurt Bond wrote:
> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.
>

Well, it's in Basic ...

1 MAP (Z) String WholeRec$=64%

Open "test.dat" for Output as File #1%, &
Organization Relative Fixed, &
Recordsize 64%, &
MAP Z

For Z% = 1% to 9%
WholeRec$ = String$(64%,(Z%+48%))
Put #1%, Record Z%
Next Z%

Close #1%

Open "test.dat" for input as file 1%, &
Organization Relative Fixed, &
MAP Z

10 Input "Record num", Z%
GoTo 99 Unless Z%
Get #1%, Record Z%
Print WholeRec$
GoTo 10

99 End

If it is not obvious, just ask ...

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<9eb82fb1-0e78-4ec5-990a-f07750e0e3f9n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29997&group=comp.os.vms#29997

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:8d07:b0:76d:c79b:4bb8 with SMTP id rb7-20020a05620a8d0700b0076dc79b4bb8mr120852qkn.1.1694947412557; Sun, 17 Sep 2023 03:43:32 -0700 (PDT)
X-Received: by 2002:a9d:6a48:0:b0:6b9:9cc3:976e with SMTP id h8-20020a9d6a48000000b006b99cc3976emr1982517otn.0.1694947412148; Sun, 17 Sep 2023 03:43:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.15.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 17 Sep 2023 03:43:31 -0700 (PDT)
In-Reply-To: <m25y49uca2.fsf@gmail.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.27.245.253; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 108.27.245.253
References: <m25y49uca2.fsf@gmail.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9eb82fb1-0e78-4ec5-990a-f07750e0e3f9n@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Sun, 17 Sep 2023 10:43:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: Bob Gezelter - Sun, 17 Sep 2023 10:43 UTC

On Saturday, September 16, 2023 at 3:51:54 PM UTC-4, T. Kurt Bond wrote:
> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.
>
> --
> T. Kurt Bond, tkur...@gmail.com, tkurtbond.github.io, consp.org, & tkb.tx0.org
Kurt,

I do not have a sample easily at hand, but the examples in the FORTRAN manual should be illuminating. I have used relative files in the past, and there was no particular problem.

- Bob Gezelter, http://www.rlgsc.com

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<bcdfc4de-2796-4e55-b79d-8f8127c5a778n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29998&group=comp.os.vms#29998

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:353:b0:412:14a0:448e with SMTP id r19-20020a05622a035300b0041214a0448emr145669qtw.1.1694949882839; Sun, 17 Sep 2023 04:24:42 -0700 (PDT)
X-Received: by 2002:a05:6870:8c09:b0:1bf:51f7:b5b4 with SMTP id ec9-20020a0568708c0900b001bf51f7b5b4mr2360132oab.7.1694949882467; Sun, 17 Sep 2023 04:24:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!69.80.99.11.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 17 Sep 2023 04:24:41 -0700 (PDT)
In-Reply-To: <m25y49uca2.fsf@gmail.com>
Injection-Info: google-groups.googlegroups.com; posting-host=70.31.98.81; posting-account=QqCTBgkAAACie99dBE6oFauYH8hE6sk0
NNTP-Posting-Host: 70.31.98.81
References: <m25y49uca2.fsf@gmail.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bcdfc4de-2796-4e55-b79d-8f8127c5a778n@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
From: n.ri...@bell.net (Neil Rieck)
Injection-Date: Sun, 17 Sep 2023 11:24:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 21
 by: Neil Rieck - Sun, 17 Sep 2023 11:24 UTC

On Saturday, September 16, 2023 at 3:51:54 PM UTC-4, T. Kurt Bond wrote:
> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.
>
> --
> T. Kurt Bond, tkur...@gmail.com, tkurtbond.github.io, consp.org, & tkb.tx0.org

Here are some demos written in VMS-BASIC

https://neilrieck.net/demo_vms_html/openvms_demo_index.html#fileio

Neil Rieck
Waterloo, Ontario, Canada.
http://neilrieck.net

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<f8c4c7db-f3ce-4824-8634-b687f522cbaan@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=29999&group=comp.os.vms#29999

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:5e0b:0:b0:403:996b:3ae with SMTP id h11-20020ac85e0b000000b00403996b03aemr112822qtx.9.1694950360459;
Sun, 17 Sep 2023 04:32:40 -0700 (PDT)
X-Received: by 2002:a05:6808:3089:b0:3a7:5742:ce92 with SMTP id
bl9-20020a056808308900b003a75742ce92mr2908902oib.0.1694950360270; Sun, 17 Sep
2023 04:32:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 17 Sep 2023 04:32:39 -0700 (PDT)
In-Reply-To: <9eb82fb1-0e78-4ec5-990a-f07750e0e3f9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:c936:a5:a2fc:8127;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:c936:a5:a2fc:8127
References: <m25y49uca2.fsf@gmail.com> <9eb82fb1-0e78-4ec5-990a-f07750e0e3f9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8c4c7db-f3ce-4824-8634-b687f522cbaan@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: gah...@u.washington.edu (gah4)
Injection-Date: Sun, 17 Sep 2023 11:32:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 39
 by: gah4 - Sun, 17 Sep 2023 11:32 UTC

On Sunday, September 17, 2023 at 3:43:34 AM UTC-7, Bob Gezelter wrote:

(snip)

> I do not have a sample easily at hand, but the examples in the FORTRAN
> manual should be illuminating.
> I have used relative files in the past, and there was no particular problem.
I used to do them in IBM Fortran, and also PDP-10 Fortran, as unformatted.

For IBM and VAX, there is DEFINE FILE to set the record size, and

WRITE(unit'record) iolist
READ(unit'record) iolist

(That is an apostrophe to indicate the record number.)

It goes:

DEFINE FILE unit(numrec, recsize, U, assov)

Where for VAX/VMS recsize is in 16 bit words.
(I believe for IBM it is 32 bit words.)

The first time it is used, the whole file is formatted into the appropriate
number and size of records.

For IBM OS/360 and descendants, it formats the disk with the specified block size.
(And normally it has a JCL DD statement also specifying the record size and
(the same) block size.)

I don't know RMS enough to know, but it should do something similar, except that
it doesn't format the physical blocks to that size.

As well as I remember the PDP-10, it has to be in whole disk blocks.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<m2sf7c7yq5.fsf@gmail.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30008&group=comp.os.vms#30008

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tkurtb...@gmail.com (T. Kurt Bond)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
Date: Mon, 18 Sep 2023 03:00:02 -0400
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <m2sf7c7yq5.fsf@gmail.com>
References: <m25y49uca2.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ee3b2ddb02babb2790014fb68eb8307d";
logging-data="1316909"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ouxDjGkkaH5tm8VaXAV4NTGTspmF84lA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
Cancel-Lock: sha1:ANwCrQTuvGYNavOzN6IbQfQiKuk=
sha1:oWs6+GzRyKgDQQ6dBEBvcl7VN/M=
 by: T. Kurt Bond - Mon, 18 Sep 2023 07:00 UTC

"T. Kurt Bond" <tkurtbond@gmail.com> wrote:
> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.

I should definitely have provided more context with my question.

I'm debugging VTIL, a VAX MACRO implementation of a Forth-like language
that I wrote in 1988. I lost the source long ago (it was saved on a
9-track tape, and probably copied later to an 8mm tape, but when we
converted the VAX to use the Charon-VAX emulator I didn't get it copied
over to some other format, alas), so I retyped it from a printout that
recently turned up, and unfortunately in the process introduced a lot of
bugs through typos.

VTIL includes Forth-style block I/O words (words are Forth's version of
functions) that allow the user to load specificed numeric 1024-byte
blocks from a file, change their contents, and write them back out.
Unfortunately, the file was created by a different program (also written
in MACRO), and that program was *not* included in the printout. The
VTIL example program that used the block I/O words was an editor that
stored its text in blocks. (Probably inspired by the editor in
*Starting Forth*.) That program was also lost.

The code in VTIL itself which opend the file only specified the block
size, that the records were fixed, and random access was done using the
block number as the key. It didn't specify the organization. I
*thought* the file was created using relative organization, but when I
tried to load a block it would fail with a message about the key being
invalid, even though when I looked at the longword in memory with the
number in it it was correct. I wrote a couple of MACRO and BASIC
programs to play around with RMS files. Still confused, I posted here.

After reading all your replies (and thank you very much) and considering
the examples provided and reading more in the RMS Reference Manual and
doing a lot of searches in that manual I figured out two things: (1) you
can do random access to a *sequential* file as long as the records are
fixed size, and (2) I'd misspelled the KBF argument to the $RAB macro as
KFB. Sigh. (SO MANY TYPOS.)

Once I knew those things I was easily able to create a macro program
(MAKE-VTILBLOCKS.MAR) to create the sequential file and write an
appropriate number of blocks to it, another (READ-VTILBLOCKS.MAR) that
was able to randomly access records in it and display bytes from them.
Once that worked I fixed the typo in VTIL.MAR and then I was able to
read a block from the block file! Then I wrote a test VTIL program to
load a block from the block file, display a byte from it, change a byte
in it, and store the updated block back in the file in such a way that
READ-VTILBLOCKS could display that byte and easily confirm it had been
updated correctly.

The VTIL repository on GitHub is https://github.com/tkurtbond/VTIL
if anyone is interested in looking at the code.

Direct links to MAKE-VITLBLOCKS.MAR:

https://github.com/tkurtbond/VTIL/blob/a547c6af02e8fdd8ee4cf31cd2c081437d163554/make-vtilblocks.mar#L1

and to READ-VITLBLOCKS.MAR:

https://github.com/tkurtbond/VTIL/blob/a547c6af02e8fdd8ee4cf31cd2c081437d163554/read-vtilblocks.mar#L1

and the line in VTIL.MAR with the typo:

https://github.com/tkurtbond/VTIL/blob/a547c6af02e8fdd8ee4cf31cd2c081437d163554/vtil.mar#L438

Thanks again for your help!
--
T. Kurt Bond, tkurtbond@gmail.com, tkurtbond.github.io, consp.org, & tkb.tx0.org

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ue9tc4$1reo7$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30017&group=comp.os.vms#30017

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mai...@SendSpamHere.ORG (Brian Schenkenberger)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
Date: Mon, 18 Sep 2023 12:20:20 -0400
Organization: Tmesis Software
Lines: 118
Message-ID: <ue9tc4$1reo7$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="96d8e14271b1d5bacbfa83e5b4db4d4a";
logging-data="1948423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tsFn/LMIkCJoYmaJfKOmu"
User-Agent: Unison/2.2
Cancel-Lock: sha1:8ODDpuIyVLlTtNoh0jJqNzJlsD8=
 by: Brian Schenkenberger - Mon, 18 Sep 2023 16:20 UTC

On 2023-09-16 19:51:49 +0000, T. Kurt Bond said:

> Does anybody have an example program that uses random access by record
> number on an RMS fixed record size, relative organization file they'd be
> willing to share? I'm missing something, probably something obvious,
> but I've not been able to get random access by record number to work.
> I'm working in VAX MACRO (on VMS 5.5-2), but should be able to use an
> example in any language.

When I was writing RMS-CDC, I worked closely with Hein. He wrote many
test/example programs to check RMS-CDC functionality. Here is one of
his program in COBOL used to test RELATIVE RMS file accesses.

IDENTIFICATION DIVISION.
PROGRAM-ID. hein.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT the-file
ASSIGN TO "test-file"
ORGANIZATION IS RELATIVE
ACCESS MODE IS DYNAMIC
RELATIVE KEY IS the-key
FILE STATUS IS file-status.
DATA DIVISION.
FILE SECTION.
FD the-file.
01 the-record.
03 some-data PIC X(80).
WORKING-STORAGE SECTION.

01 the-key-txt.
03 filler PIC X(1) VALUE "(".
03 the-key PIC 9(9).
03 filler PIC X(2) VALUE ") ".
01 txt-key PIC X(9).
01 x PIC 9(9) COMP.
01 choice PIC 9.
01 file-status PIC XX.
01 sts PIC 9(9).
01 stv PIC 9(9).

01 rab_pt POINTER.
01 rfa_pt POINTER.

01 rfa.
03 vbn PIC 9(9) COMP VALUE 0.
03 id PIC 9(4) COMP VALUE 0.

01 rfa-txt.
03 filler PIC X(6) VALUE " RFA=(".
03 vbn-txt PIC 9(9).
03 filler PIC X(1) VALUE ",".
03 id-txt PIC 9(4).
03 filler PIC X(6) VALUE ") Rec=".

PROCEDURE DIVISION.

DECLARATIVES.
ERROR-HANDLER SECTION.
USE AFTER STANDARD EXCEPTION PROCEDURE ON the-file.
HERE-WE-GO.
MOVE RMS-STS TO sts.
MOVE RMS-STV TO stv.
DISPLAY "File status ", file-status, " STS=", sts, " STV=", stv.
END DECLARATIVES.

MAIN-CONTROL SECTION.
begin-here.
OPEN I-O the-file ALLOWING ALL.
CALL "DCOB$RMS_CURRENT_RAB" GIVING rab_pt
ADD 16 TO rab_pt GIVING rfa_pt.
The-loop.
CALL "OTS$MOVE3" USING BY VALUE 6, BY VALUE RFA_PT, BY REFERENCE RFA.
MOVE "----------------------------------------" TO some-data.

DISPLAY "1 Read, 2 Next, 3 Write, 4 Update, 5 Delete ? "
WITH NO ADVANCING
ACCEPT choice AT END STOP RUN.
GO TO 1-Read, 2-Next, 3-Write, 4-Update, 5-Delete
DEPENDING ON choice.
1-Read.
DISPLAY "Key value: " WITH NO ADVANCING.
ACCEPT txt-key AT END GO TO the-loop.
MOVE 0 to x.
INSPECT txt-key TALLYING x FOR CHARACTERS BEFORE INITIAL SPACE.
MOVE txt-key(1:x) TO the-key.
READ the-file RECORD.
DISPLAY the-key-txt, some-data.
GO TO the-loop.
2-Next.
READ the-file NEXT RECORD.
DISPLAY the-key-txt, some-data.
GO TO the-loop.
3-Write.
DISPLAY "Key value: " WITH NO ADVANCING.
ACCEPT txt-key AT END GO TO the-loop.
MOVE 0 to x.
INSPECT txt-key TALLYING x FOR CHARACTERS BEFORE INITIAL SPACE.
MOVE txt-key(1:x) TO the-key.
DISPLAY "New data : " WITH NO ADVANCING.
ACCEPT some-data AT END GO TO 3-Write.
WRITE the-record.
CALL "SYS$FLUSH" USING BY VALUE rab_pt.
GO TO the-loop.
4-Update.
DISPLAY "New data : " WITH NO ADVANCING.
ACCEPT some-data.
REWRITE the-record.
GO TO the-loop.
5-Delete.
DELETE the-file RECORD.
GO TO the-loop.

— VAXman

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ZJmdncmDv-xoLJX4nZ2dnZfqn_GdnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30018&group=comp.os.vms#30018

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 18 Sep 2023 20:24:21 +0000
Sender: Dennis Boone <drb@yagi.h-net.org>
From: drb...@ihatespam.msu.edu (Dennis Boone)
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
Newsgroups: comp.os.vms
References: <m25y49uca2.fsf@gmail.com> <m2sf7c7yq5.fsf@gmail.com>
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (FreeBSD/13.1-RELEASE-p2 (amd64))
Message-ID: <ZJmdncmDv-xoLJX4nZ2dnZfqn_GdnZ2d@giganews.com>
Date: Mon, 18 Sep 2023 20:24:21 +0000
Lines: 11
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-CEmm5MjQerxuOZKqiB1ys25b6VdBJfsEFDgpz5N3B3d2InvHpQNSfSkSRLKKL+SEl59t6eJ+WekgE0G!lQ2H7WDuY7IKAA2yhc0wAE9DfEDqndDdZfIiZvO6LKMzU8m2BXv03atnYB1dw6QyOZ+pzbM=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Dennis Boone - Mon, 18 Sep 2023 20:24 UTC

> that I wrote in 1988. I lost the source long ago (it was saved on a
> 9-track tape, and probably copied later to an 8mm tape, but when we
> converted the VAX to use the Charon-VAX emulator I didn't get it copied
> over to some other format, alas), so I retyped it from a printout that
> recently turned up, and unfortunately in the process introduced a lot of
> bugs through typos.

I'll point out for completeness, if nothing else, that said 9track
can still be read, if it's around.

De

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<kms3doFcg06U4@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30020&group=comp.os.vms#30020

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Mon, 18 Sep 2023 19:05:27 -0400
Lines: 17
Message-ID: <kms3doFcg06U4@mid.individual.net>
References: <m25y49uca2.fsf@gmail.com> <m2sf7c7yq5.fsf@gmail.com>
<ZJmdncmDv-xoLJX4nZ2dnZfqn_GdnZ2d@giganews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net OVj9o/1b+V4AIoTglYlQ0A28Gq1F2MqQxJCSrbys6WY8AVEzxO
Cancel-Lock: sha1:dRRlyd282MeFT2d8El3mbJjKTjg= sha256:5TqL8Eh+I730mkW5RvllF9JH1pBBkuBtRBcO9QA4UIk=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Content-Language: en-US
In-Reply-To: <ZJmdncmDv-xoLJX4nZ2dnZfqn_GdnZ2d@giganews.com>
 by: bill - Mon, 18 Sep 2023 23:05 UTC

On 9/18/2023 4:24 PM, Dennis Boone wrote:
> > that I wrote in 1988. I lost the source long ago (it was saved on a
> > 9-track tape, and probably copied later to an 8mm tape, but when we
> > converted the VAX to use the Charon-VAX emulator I didn't get it copied
> > over to some other format, alas), so I retyped it from a printout that
> > recently turned up, and unfortunately in the process introduced a lot of
> > bugs through typos.
>
> I'll point out for completeness, if nothing else, that said 9track
> can still be read, if it's around.
>

I have a 9-track drive. SCSI, so it can definitely still be read.

bill

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<uedf9t$2jhca$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30029&group=comp.os.vms#30029

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Tue, 19 Sep 2023 20:44:45 -0400
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uedf9t$2jhca$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 00:44:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="2737546"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4eWKzagOoSh2nA42p9zBCAKt8MdbqXdk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:EzZAajHtGV8nA1eYal74T4M405E=
Content-Language: en-US
In-Reply-To: <ue52ev$3vimm$1@dont-email.me>
 by: Arne Vajhøj - Wed, 20 Sep 2023 00:44 UTC

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!

:-)

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<uedfd1$2jhca$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30030&group=comp.os.vms#30030

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Tue, 19 Sep 2023 20:46:24 -0400
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <uedfd1$2jhca$2@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 00:46:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="2737546"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/euPufmZXx/ODsG1Y93H97LU0eqjE2KlQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:o6KP+3ptFRwIBi6TCfxosxTHWuM=
In-Reply-To: <uedf9t$2jhca$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Wed, 20 Sep 2023 00:46 UTC

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!

Fortran:

$ type relwrt.for
program relwrt
integer*4 i, buflen
character*80 buf
open(unit=1,file='rel.dat',status='new',form='formatted',
+ organization='relative',recl=512,recordtype='variable',
+ access='direct')
do 100 i = 1, 100
write(buf,'(14HThis is line #,i4.4,1H!)') i
buflen = index(buf,'!')
write(unit=1,rec=i) buf(1:buflen)
100 continue
close(unit=1)
end
$ for relwrt
$ link relwrt
$ run relwrt
$ type relrdseq.for
program relrdseq
integer*4 i, buflen
character*80 buf
open(unit=1,file='rel.dat',status='old',form='formatted',
+ organization='relative',recl=512,recordtype='variable',
+ access='sequential')
100 read(unit=1,fmt='(q,a)',end=200) buflen,buf
write(*,*) '|'//buf(1:buflen)//'|'
goto 100
200 close(unit=1)
end
$ for relrdseq
$ link relrdseq
$ run relrdseq
|This is line #0001!|
|This is line #0002!|
....
|This is line #0100!|
$ type relrddir.for
program relrddir
integer*4 i, buflen
character*80 buf
open(unit=1,file='rel.dat',status='old',form='formatted',
+ organization='relative',recl=512,recordtype='variable',
+ access='direct')
do 200 i = 1, 100
read(unit=1,fmt='(q,a)',rec=i) buflen,buf
write(*,*) '|'//buf(1:buflen)//'|'
200 continue
close(unit=1)
end
$ for relrddir
$ link relrddir
$ run relrddir
|This is line #0001!|
|This is line #0002!|
....
|This is line #0100!|

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<uedfh3$2jhca$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30031&group=comp.os.vms#30031

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Tue, 19 Sep 2023 20:48:35 -0400
Organization: A noiseless patient Spider
Lines: 102
Message-ID: <uedfh3$2jhca$3@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 00:48:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="2737546"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19n9SxRHf/kJMHvMaDu4ovgEuOAQ+Jkr4E="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:lh/kVL3924wI3XA12tJeL5Ybkd8=
Content-Language: en-US
In-Reply-To: <uedf9t$2jhca$1@dont-email.me>
 by: Arne Vajhøj - Wed, 20 Sep 2023 00:48 UTC

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!

Pascal:

$ type relwrt.pas
program relwrt(input,output);

type
string = varying [255] of char;

var
i : integer;
buf : string;
f : file of string;

begin
open(f, 'rel.dat', new,
organization := relative, record_length := 512, record_type :=
variable,
access_method := direct);
rewrite(f);
for i := 1 to 100 do begin
buf := 'This is line #' + dec(i, 4);
locate(f, i);
f^ := buf;
put(f);
end;
close(f);
end.
$ pas relwrt
$ link relwrt
$ run relwrt
$ type relrdseq.pas
program relrddir(input,output);

type
string = varying [255] of char;

var
i : integer;
buf : string;
f : file of string;

begin
open(f, 'rel.dat', old,
organization := relative, record_length := 512, record_type :=
variable,
access_method := sequential);
reset(f);
while not eof(f) do begin
buf := f^;
writeln('|' + buf + '|');
get(f);
end;
close(f);
end.
$ pas relrdseq
$ link relrdseq
$ run relrdseq
|This is line #0001|
|This is line #0002|
....
|This is line #0100|
$ type relrddir.pas
program relrddir(input,output);

type
string = varying [255] of char;

var
i : integer;
buf : string;
f : file of string;

begin
open(f, 'rel.dat', old,
organization := relative, record_length := 512, record_type :=
variable,
access_method := direct);
reset(f);
for i := 1 to 100 do begin
find(f, i);
buf := f^;
writeln('|' + buf + '|');
end;
close(f);
end.
$ pas relrddir
$ link relrddir
$ run relrddir
|This is line #0001|
|This is line #0002|
....
|This is line #0100|

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<uedfkq$2jhca$4@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30032&group=comp.os.vms#30032

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Tue, 19 Sep 2023 20:50:34 -0400
Organization: A noiseless patient Spider
Lines: 201
Message-ID: <uedfkq$2jhca$4@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 00:50:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="2737546"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wwpmVOh4buIkoyqjMGFzR8TTJ28D7as8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OFfQr+v8/ETQSyv01N4LDv2RmZw=
Content-Language: en-US
In-Reply-To: <uedf9t$2jhca$1@dont-email.me>
 by: Arne Vajhøj - Wed, 20 Sep 2023 00:50 UTC

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:

$ type relwrt.c
#include <stdio.h>
#include <string.h>

#include <starlet.h>
#include <rms.h>

#define FNM "rel.dat"

int main(int argc, char *argv[])
{ long stat;
struct FAB fab;
struct RAB rab;
int i;
char buf[80];
fab = cc$rms_fab;
fab.fab$l_fna = (char *)FNM;
fab.fab$b_fns = strlen(FNM);
fab.fab$b_org = FAB$C_REL;
fab.fab$b_rfm = FAB$C_VAR;
fab.fab$l_fop = FAB$M_CIF;
fab.fab$w_mrs = 512;
fab.fab$b_fac = FAB$M_PUT;
stat = sys$create(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$create stat = %d\n", stat);
}
rab = cc$rms_rab;
rab.rab$l_fab = &fab;
rab.rab$b_rac = RAB$C_KEY;
stat = sys$connect(&rab, 0 ,0);
if(!(stat & 1)) {
printf("sys$connect stat = %d\n", stat);
}
for(i = 1; i <= 100; i++)
{
sprintf(buf, "This is line #%04d!", i);
rab.rab$l_kbf = (char *)&i;
rab.rab$b_ksz = sizeof(i);
rab.rab$l_rbf = buf;
rab.rab$w_rsz = strlen(buf);
stat = sys$put(&rab, 0, 0);
if(!(stat & 1)) {
printf("sys$put stat = %d\n", stat);
}
}
stat = sys$disconnect(&rab, 0, 0);
if(!(stat & 1)) {
printf("sys$disconnect stat = %d\n", stat);
}
stat = sys$close(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$close stat = %d\n", stat);
}
return 0;
}

$ cc relwrt
$ link relwrt
$ run relwrt
$ type relrdseq.c
#include <stdio.h>
#include <string.h>

#include <starlet.h>
#include <rms.h>

#define FNM "rel.dat"

int main(int argc, char *argv[])
{ long stat;
struct FAB fab;
struct RAB rab;
char buf[80];
fab = cc$rms_fab;
fab.fab$l_fna = (char *)FNM;
fab.fab$b_fns = strlen(FNM);
fab.fab$b_org = FAB$C_REL;
fab.fab$b_rfm = FAB$C_VAR;
fab.fab$w_mrs = 512;
fab.fab$b_fac = FAB$M_GET;
stat = sys$open(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$open stat = %d\n", stat);
}
rab = cc$rms_rab;
rab.rab$l_fab = &fab;
rab.rab$b_rac = RAB$C_SEQ;
stat = sys$connect(&rab, 0 ,0);
if(!(stat & 1)) {
printf("sys$connect stat = %d\n", stat);
}
for(;;)
{
rab.rab$l_ubf = buf;
rab.rab$w_usz = sizeof(buf);
stat = sys$get(&rab, 0, 0);
if(stat == RMS$_EOF) break;
if(!(stat & 1)) {
printf("sys$get stat = %d\n", stat);
}
buf[rab.rab$w_rsz] = 0;
printf("|%s|\n", buf);
}
stat = sys$disconnect(&rab, 0, 0);
if(!(stat & 1)) {
printf("sys$disconnect stat = %d\n", stat);
}
stat = sys$close(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$close stat = %d\n", stat);
}
return 0;
}

$ cc relrdseq
$ link relrdseq
$ run relrdseq
|This is line #0001!|
|This is line #0002!|
....
|This is line #0100!|
$ type relrddir.c
#include <stdio.h>
#include <string.h>

#include <starlet.h>
#include <rms.h>

#define FNM "rel.dat"

int main(int argc, char *argv[])
{ long stat;
struct FAB fab;
struct RAB rab;
int i;
char buf[80];
fab = cc$rms_fab;
fab.fab$l_fna = (char *)FNM;
fab.fab$b_fns = strlen(FNM);
fab.fab$b_org = FAB$C_REL;
fab.fab$b_rfm = FAB$C_VAR;
fab.fab$w_mrs = 512;
fab.fab$b_fac = FAB$M_GET;
stat = sys$open(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$open stat = %d\n", stat);
}
rab = cc$rms_rab;
rab.rab$l_fab = &fab;
rab.rab$b_rac = RAB$C_KEY;
stat = sys$connect(&rab, 0 ,0);
if(!(stat & 1)) {
printf("sys$connect stat = %d\n", stat);
}
for(i = 1; i <= 100; i++)
{
rab.rab$l_kbf = (char *)&i;
rab.rab$b_ksz = sizeof(i);
rab.rab$l_ubf = buf;
rab.rab$w_usz = sizeof(buf);
stat = sys$get(&rab, 0, 0);
if(!(stat & 1)) {
printf("sys$get stat = %d\n", stat);
}
buf[rab.rab$w_rsz] = 0;
printf("|%s|\n", buf);
}
stat = sys$disconnect(&rab, 0, 0);
if(!(stat & 1)) {
printf("sys$disconnect stat = %d\n", stat);
}
stat = sys$close(&fab, 0, 0);
if(!(stat & 1)) {
printf("sys$close stat = %d\n", stat);
}
return 0;
}

$ cc relrddir
$ link relrddir
$ run relrddir
|This is line #0001!|
|This is line #0002!|
....
|This is line #0100!|

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30033&group=comp.os.vms#30033

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:1b94:b0:76d:567a:42f0 with SMTP id dv20-20020a05620a1b9400b0076d567a42f0mr20352qkb.3.1695179720201;
Tue, 19 Sep 2023 20:15:20 -0700 (PDT)
X-Received: by 2002:a05:6870:5aae:b0:1c8:f237:303a with SMTP id
dt46-20020a0568705aae00b001c8f237303amr529844oab.5.1695179719960; Tue, 19 Sep
2023 20:15:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Tue, 19 Sep 2023 20:15:19 -0700 (PDT)
In-Reply-To: <uedfd1$2jhca$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:c0dc:3b37:8b02:ab9d;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:c0dc:3b37:8b02:ab9d
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: gah...@u.washington.edu (gah4)
Injection-Date: Wed, 20 Sep 2023 03:15:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1797
 by: gah4 - Wed, 20 Sep 2023 03:15 UTC

On Tuesday, September 19, 2023 at 5:46:29 PM UTC-7, Arne Vajhøj wrote:

(snip)

> 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.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<uedqqs$2p2ng$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30034&group=comp.os.vms#30034

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Wed, 20 Sep 2023 00:02:30 -0400
Organization: A noiseless patient Spider
Lines: 212
Message-ID: <uedqqs$2p2ng$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfkq$2jhca$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 04:01:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="752fe0de7febc47e7f43bca2e4d924c2";
logging-data="2919152"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++lt1RNKAWH2qP886dAZryRVbBAvJbSbs="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:hix0tk7ytccATPr6U9A90oIDSMk=
In-Reply-To: <uedfkq$2jhca$4@dont-email.me>
 by: Dave Froble - Wed, 20 Sep 2023 04:02 UTC

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:
>
> $ type relwrt.c
> #include <stdio.h>
> #include <string.h>
>
> #include <starlet.h>
> #include <rms.h>
>
> #define FNM "rel.dat"
>
> int main(int argc, char *argv[])
> {
> long stat;
> struct FAB fab;
> struct RAB rab;
> int i;
> char buf[80];
> fab = cc$rms_fab;
> fab.fab$l_fna = (char *)FNM;
> fab.fab$b_fns = strlen(FNM);
> fab.fab$b_org = FAB$C_REL;
> fab.fab$b_rfm = FAB$C_VAR;
> fab.fab$l_fop = FAB$M_CIF;
> fab.fab$w_mrs = 512;
> fab.fab$b_fac = FAB$M_PUT;
> stat = sys$create(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$create stat = %d\n", stat);
> }
> rab = cc$rms_rab;
> rab.rab$l_fab = &fab;
> rab.rab$b_rac = RAB$C_KEY;
> stat = sys$connect(&rab, 0 ,0);
> if(!(stat & 1)) {
> printf("sys$connect stat = %d\n", stat);
> }
> for(i = 1; i <= 100; i++)
> {
> sprintf(buf, "This is line #%04d!", i);
> rab.rab$l_kbf = (char *)&i;
> rab.rab$b_ksz = sizeof(i);
> rab.rab$l_rbf = buf;
> rab.rab$w_rsz = strlen(buf);
> stat = sys$put(&rab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$put stat = %d\n", stat);
> }
> }
> stat = sys$disconnect(&rab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$disconnect stat = %d\n", stat);
> }
> stat = sys$close(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$close stat = %d\n", stat);
> }
> return 0;
> }
>
> $ cc relwrt
> $ link relwrt
> $ run relwrt
> $ type relrdseq.c
> #include <stdio.h>
> #include <string.h>
>
> #include <starlet.h>
> #include <rms.h>
>
> #define FNM "rel.dat"
>
> int main(int argc, char *argv[])
> {
> long stat;
> struct FAB fab;
> struct RAB rab;
> char buf[80];
> fab = cc$rms_fab;
> fab.fab$l_fna = (char *)FNM;
> fab.fab$b_fns = strlen(FNM);
> fab.fab$b_org = FAB$C_REL;
> fab.fab$b_rfm = FAB$C_VAR;
> fab.fab$w_mrs = 512;
> fab.fab$b_fac = FAB$M_GET;
> stat = sys$open(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$open stat = %d\n", stat);
> }
> rab = cc$rms_rab;
> rab.rab$l_fab = &fab;
> rab.rab$b_rac = RAB$C_SEQ;
> stat = sys$connect(&rab, 0 ,0);
> if(!(stat & 1)) {
> printf("sys$connect stat = %d\n", stat);
> }
> for(;;)
> {
> rab.rab$l_ubf = buf;
> rab.rab$w_usz = sizeof(buf);
> stat = sys$get(&rab, 0, 0);
> if(stat == RMS$_EOF) break;
> if(!(stat & 1)) {
> printf("sys$get stat = %d\n", stat);
> }
> buf[rab.rab$w_rsz] = 0;
> printf("|%s|\n", buf);
> }
> stat = sys$disconnect(&rab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$disconnect stat = %d\n", stat);
> }
> stat = sys$close(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$close stat = %d\n", stat);
> }
> return 0;
> }
>
> $ cc relrdseq
> $ link relrdseq
> $ run relrdseq
> |This is line #0001!|
> |This is line #0002!|
> ...
> |This is line #0100!|
> $ type relrddir.c
> #include <stdio.h>
> #include <string.h>
>
> #include <starlet.h>
> #include <rms.h>
>
> #define FNM "rel.dat"
>
> int main(int argc, char *argv[])
> {
> long stat;
> struct FAB fab;
> struct RAB rab;
> int i;
> char buf[80];
> fab = cc$rms_fab;
> fab.fab$l_fna = (char *)FNM;
> fab.fab$b_fns = strlen(FNM);
> fab.fab$b_org = FAB$C_REL;
> fab.fab$b_rfm = FAB$C_VAR;
> fab.fab$w_mrs = 512;
> fab.fab$b_fac = FAB$M_GET;
> stat = sys$open(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$open stat = %d\n", stat);
> }
> rab = cc$rms_rab;
> rab.rab$l_fab = &fab;
> rab.rab$b_rac = RAB$C_KEY;
> stat = sys$connect(&rab, 0 ,0);
> if(!(stat & 1)) {
> printf("sys$connect stat = %d\n", stat);
> }
> for(i = 1; i <= 100; i++)
> {
> rab.rab$l_kbf = (char *)&i;
> rab.rab$b_ksz = sizeof(i);
> rab.rab$l_ubf = buf;
> rab.rab$w_usz = sizeof(buf);
> stat = sys$get(&rab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$get stat = %d\n", stat);
> }
> buf[rab.rab$w_rsz] = 0;
> printf("|%s|\n", buf);
> }
> stat = sys$disconnect(&rab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$disconnect stat = %d\n", stat);
> }
> stat = sys$close(&fab, 0, 0);
> if(!(stat & 1)) {
> printf("sys$close stat = %d\n", stat);
> }
> return 0;
> }
>
> $ cc relrddir
> $ link relrddir
> $ run relrddir
> |This is line #0001!|
> |This is line #0002!|
> ...
> |This is line #0100!|
>
> Arne
>
>

Is it just me, or, was my Basic example shorter and easier to read than your
Cobol, Fortran, and C examples?

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<73b3ab3b-c673-4d19-a417-ee1a6970617an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30035&group=comp.os.vms#30035

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:5a48:0:b0:641:8c92:29f2 with SMTP id ej8-20020ad45a48000000b006418c9229f2mr13587qvb.5.1695183520877;
Tue, 19 Sep 2023 21:18:40 -0700 (PDT)
X-Received: by 2002:a05:6808:1997:b0:3ac:b428:844d with SMTP id
bj23-20020a056808199700b003acb428844dmr772771oib.8.1695183520504; Tue, 19 Sep
2023 21:18:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Tue, 19 Sep 2023 21:18:40 -0700 (PDT)
In-Reply-To: <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.234.171.161; posting-account=U1iMPAoAAAC9r8wm0KaW63EcF8sfjFeH
NNTP-Posting-Host: 73.234.171.161
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me> <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <73b3ab3b-c673-4d19-a417-ee1a6970617an@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: heinvand...@gmail.com (Hein RMS van den Heuvel)
Injection-Date: Wed, 20 Sep 2023 04:18:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2836
 by: Hein RMS van den Heu - Wed, 20 Sep 2023 04:18 UTC

On Tuesday, September 19, 2023 at 11:15:21 PM UTC-4, gah4 wrote:
> On Tuesday, September 19, 2023 at 5:46:29 PM UTC-7, Arne Vajhøj wrote:
>
> (snip)
> > 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.

Yes indeed traditionally folks only had half a clue about RMS and vaguely know 512 was a special value and very popular.

With that they proceeded to maximize their storage losses.

The one flag byte overhead relative file records have (plus two for variable) makes the cells larger than 512
By default FORTRANT/RMS will now use the default 2 block bucketsize
Thus wasting 511 (509) bytes per 512 byte record.

Running Arne's sample code:

$ sear/log rel.dat blah
%SEARCH-S-NOMATCH, DSA3:[DECUSERVE_USER.HEIN]REL.DAT;1 - 100 records
$ dire/full rel.dat
: File organization: Relative, maximum record number: 2147483647
File attributes: Allocation: 201, Extend: 0, Bucket size: 2, Global buffer count: 0, No version limit
Record format: Variable length, maximum 512 bytes, longest 0 bytes
: Total of 1 file, 201/201 blocks.
$

Grins,
Hein.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<4f2abc22-5fb8-48f7-8631-8ac37e58b748n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30039&group=comp.os.vms#30039

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:4247:0:b0:412:7ea:37c9 with SMTP id r7-20020ac84247000000b0041207ea37c9mr93398qtm.5.1695194314366;
Wed, 20 Sep 2023 00:18:34 -0700 (PDT)
X-Received: by 2002:a05:6870:954c:b0:1d1:3ff8:9f80 with SMTP id
v12-20020a056870954c00b001d13ff89f80mr700009oal.8.1695194314134; Wed, 20 Sep
2023 00:18:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 20 Sep 2023 00:18:33 -0700 (PDT)
In-Reply-To: <73b3ab3b-c673-4d19-a417-ee1a6970617an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:c0dc:3b37:8b02:ab9d;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:c0dc:3b37:8b02:ab9d
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me>
<1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com> <73b3ab3b-c673-4d19-a417-ee1a6970617an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4f2abc22-5fb8-48f7-8631-8ac37e58b748n@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: gah...@u.washington.edu (gah4)
Injection-Date: Wed, 20 Sep 2023 07:18:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: gah4 - Wed, 20 Sep 2023 07:18 UTC

On Tuesday, September 19, 2023 at 9:18:43 PM UTC-7, Hein RMS van den Heuvel wrote:
> On Tuesday, September 19, 2023 at 11:15:21 PM UTC-4, gah4 wrote:

(snip)
> > 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.

> Yes indeed traditionally folks only had half a clue about RMS and vaguely know 512 was a special value and very popular.
>
> With that they proceeded to maximize their storage losses.
>
> The one flag byte overhead relative file records have (plus two for variable) makes the cells larger than 512
> By default FORTRANT/RMS will now use the default 2 block bucketsize
> Thus wasting 511 (509) bytes per 512 byte record.
>
> Running Arne's sample code:
>
> $ sear/log rel.dat blah
> %SEARCH-S-NOMATCH, DSA3:[DECUSERVE_USER.HEIN]REL.DAT;1 - 100 records
> $ dire/full rel.dat
> :
> File organization: Relative, maximum record number: 2147483647
> File attributes: Allocation: 201, Extend: 0, Bucket size: 2, Global buffer count: 0, No version limit
> Record format: Variable length, maximum 512 bytes, longest 0 bytes
> :
> Total of 1 file, 201/201 blocks.
> $
I was remembering the PDP-10, which has 128 36bit words per disk block.

And I do remember carefully designing the record to be 128 words.
(There are no overhead words for direct access file for Fortran-10.)

I wrote a Fortran-10 program as a translation of a BASIC program
called PCAVES, public caves ,which allowed you to move, write on
the walls, and dig new rooms. It was one file block per room.

The HP BASIC system uses, I believe, 256 byte blocks for its files.

That was the time of FILDAE, which allowed one to have file that could
be accessed by others running (only) your program.

And I had record locking, which was done with MACRO-10 subroutines,
as Fortran didn't do it.

IBM OS/360 formats the disk tracks for the record size you select.
There is no need for a special size, though there is overhead.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ueek9a$2teef$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30041&group=comp.os.vms#30041

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Wed, 20 Sep 2023 07:15:55 -0400
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ueek9a$2teef$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfkq$2jhca$4@dont-email.me>
<uedqqs$2p2ng$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 11:15:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="3062223"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bMSWr/lGsTXFHISw9pxaMSbk9Seqin5c="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:tT4xN5S1OxoMPiryVSBH8wTxiYw=
In-Reply-To: <uedqqs$2p2ng$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Wed, 20 Sep 2023 11:15 UTC

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.

What is easier to read depends a lot on what language
people know.

:-)

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ueekcd$2teef$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30042&group=comp.os.vms#30042

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Wed, 20 Sep 2023 07:17:34 -0400
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ueekcd$2teef$2@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me>
<1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 11:17:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="645f718f547781ed78ee68e1f12591bc";
logging-data="3062223"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7G5WlP3qAv3Rl7WyTwbIJubw+m9EhVDA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OWsE6LVsWk9+qd1/B6LJ1O+xRXI=
Content-Language: en-US
In-Reply-To: <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
 by: Arne Vajhøj - Wed, 20 Sep 2023 11:17 UTC

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.

Arne

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ueeo6p$2u101$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30044&group=comp.os.vms#30044

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
Date: Wed, 20 Sep 2023 12:22:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <ueeo6p$2u101$1@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me> <uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me> <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com> <ueekcd$2teef$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Sep 2023 12:22:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e12178274a13bd83c64a04a99c996120";
logging-data="3081217"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K9WLZyw5u5UwAAX21FqOPnmtmY0Jqr40="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:MINs2+sRx95hWEn3DJNNuel2fm8=
 by: Simon Clubley - Wed, 20 Sep 2023 12:22 UTC

On 2023-09-20, Arne Vajhøj <arne@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@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<ueeoac$2u101$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30045&group=comp.os.vms#30045

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record size, relative organization file?
Date: Wed, 20 Sep 2023 12:24:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ueeoac$2u101$2@dont-email.me>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me> <uedf9t$2jhca$1@dont-email.me> <uedfkq$2jhca$4@dont-email.me> <uedqqs$2p2ng$1@dont-email.me>
Injection-Date: Wed, 20 Sep 2023 12:24:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e12178274a13bd83c64a04a99c996120";
logging-data="3081217"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18e/glW4ZienSHqdY8K8VwcMz3ukVP/mSw="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:talZODcVhs9vTa0QWxyGpKoOBmA=
 by: Simon Clubley - Wed, 20 Sep 2023 12:24 UTC

On 2023-09-20, Dave Froble <davef@tsoft-inc.com> wrote:
>
> Is it just me, or, was my Basic example shorter and easier to read than your
> Cobol, Fortran, and C examples?
>

Arne could always add a Macro-32 example to that list... :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<kn0kjuFcg04U6@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30046&group=comp.os.vms#30046

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
Date: Wed, 20 Sep 2023 12:23:24 -0400
Lines: 24
Message-ID: <kn0kjuFcg04U6@mid.individual.net>
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me>
<1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net zLQvCJNjdvt3MwzDapq9cgkHf2llbH8w/JD7gAZErX/ejt2miD
Cancel-Lock: sha1:+pQvwH4FRDSfYDR8tMfsCjGBLu4= sha256:grpXNUTPxnnZGj9krpjEWYy7PkU7M6STOZD2I5Y4LxI=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Content-Language: en-US
In-Reply-To: <1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com>
 by: bill - Wed, 20 Sep 2023 16:23 UTC

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:
>
> (snip)
>
>> 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.

I have an example in COBOL I just wrote if anyone is interested.

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.

bill

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<faa18044-6ce1-48aa-a1a2-236607274755n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30048&group=comp.os.vms#30048

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:1a26:b0:40f:e0dd:8050 with SMTP id f38-20020a05622a1a2600b0040fe0dd8050mr65236qtb.5.1695240677270;
Wed, 20 Sep 2023 13:11:17 -0700 (PDT)
X-Received: by 2002:a05:6808:219d:b0:3a4:1e93:8988 with SMTP id
be29-20020a056808219d00b003a41e938988mr1654954oib.10.1695240677068; Wed, 20
Sep 2023 13:11:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 20 Sep 2023 13:11:16 -0700 (PDT)
In-Reply-To: <ueeo6p$2u101$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:bd0e:72ea:3dde:82d2;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:bd0e:72ea:3dde:82d2
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfd1$2jhca$2@dont-email.me>
<1a91f2d6-faa6-495a-8d60-8ab0fe1e725en@googlegroups.com> <ueekcd$2teef$2@dont-email.me>
<ueeo6p$2u101$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <faa18044-6ce1-48aa-a1a2-236607274755n@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: gah...@u.washington.edu (gah4)
Injection-Date: Wed, 20 Sep 2023 20:11:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2508
 by: gah4 - Wed, 20 Sep 2023 20:11 UTC

On Wednesday, September 20, 2023 at 5:22:55 AM UTC-7, Simon Clubley wrote:

(snip)
> >> 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')

(then I wrote)
> >> 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.

(snip)

> 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.

OK, I finally got back to checking the Fortran standard.

It seems that variable length direct access hasn't made its
way to the Fortran standard yet. Implementations are allowed to
have extensions, so it seems that VMS has this one.

Re: Example of random access by record number on an RMS fixed record size, relative organization file?

<3f7d045b-8d89-43ec-a36d-f650d7a44d7an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30049&group=comp.os.vms#30049

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:6a0d:b0:76f:1614:575c with SMTP id uc13-20020a05620a6a0d00b0076f1614575cmr42772qkn.2.1695244944726;
Wed, 20 Sep 2023 14:22:24 -0700 (PDT)
X-Received: by 2002:a9d:674a:0:b0:6bc:e2b0:7446 with SMTP id
w10-20020a9d674a000000b006bce2b07446mr1205798otm.1.1695244944404; Wed, 20 Sep
2023 14:22:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 20 Sep 2023 14:22:23 -0700 (PDT)
In-Reply-To: <ueeoac$2u101$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=73.234.171.161; posting-account=U1iMPAoAAAC9r8wm0KaW63EcF8sfjFeH
NNTP-Posting-Host: 73.234.171.161
References: <m25y49uca2.fsf@gmail.com> <ue52ev$3vimm$1@dont-email.me>
<uedf9t$2jhca$1@dont-email.me> <uedfkq$2jhca$4@dont-email.me>
<uedqqs$2p2ng$1@dont-email.me> <ueeoac$2u101$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f7d045b-8d89-43ec-a36d-f650d7a44d7an@googlegroups.com>
Subject: Re: Example of random access by record number on an RMS fixed record
size, relative organization file?
From: heinvand...@gmail.com (Hein RMS van den Heuvel)
Injection-Date: Wed, 20 Sep 2023 21:22:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2764
 by: Hein RMS van den Heu - Wed, 20 Sep 2023 21:22 UTC

On Wednesday, September 20, 2023 at 8:24:48 AM UTC-4, Simon Clubley wrote:
> On 2023-09-20, Dave Froble <da...@tsoft-inc.com> wrote:
> >
> > Is it just me, or, was my Basic example shorter and easier to read than your
> > Cobol, Fortran, and C examples?
> >
> Arne could always add a Macro-32 example to that list... :-)

We all realize that the OP question has been answered and that RMS Relative files are really a moot point in the whole discussion right?

That said... Macro anyone? See below.

Hein.

.psect data, wrt, noexe
buf: .blkb 32*1024
fao_d: .ascid "This is line #!4ZL!!"
out_s: .long 0
out_d: .long 512
.address buf
outfab: $FAB fnm=rel.dat, org=rel, fac=put, bks=32, mrs=512, rfm=var, rat=cr
outrab: $RAB fab=outfab, rbf=buf, rsz=500

.psect code, nowrt, exe
.entry start,0
$create fab=outfab
$connect rab=outrab
blbc r0, end
clrl r10
loop: incl r10
cmpl r10, #100
bgtr end
movl #512, out_d
pushl r10
pushal out_d
pushal out_s
pushal fao_d
calls #4, g^sys$fao
blbc r0, end
movw out_s, outrab+rab$w_rsz
$put rab=outrab
blbs r0, loop
end:
ret
.end start

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor