[Info-vax] Example of random access by record number on an RMS fixed record size, relative organization file?
Dave Froble
davef at tsoft-inc.com
Sat Sep 16 20:40:16 EDT 2023
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 at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list