Home · Articles · Downloads · Hobby Wear · Forums · Web Links · News CategoriesThursday, March 28, 2024
Navigation
Home
Articles
Downloads
Hobby Wear
FAQ
Forums
Web Links
News Categories
Contact Us
Photo Gallery
OpenVMS Bigot
Search
Users Online
Guests Online: 5
No Members Online

Registered Members: 7,708
Newest Member: nifseg
Sponsors
Island Computer
View Thread
OpenVMS Hobbyist Program | Hobbyists and OpenVMS | How I Use OpenVMS
Author How can I create and write to an indexed file and then read from it in DCL?
JonathanBelanger
Member

Posts: 42
Joined: 09.06.16
Posted on August 01 2016 13:02
Hi All,

Let's see if someone can help me. I want to create an empty indexed file that contains an integer key with the name LINE and a text string with up to 1024 bytes. I figure I'm going to have to use the CREATE command with the /FDL qualifier, but cannot figure out how to do this. I then want to be able to use the WRITE command to right a record to this indexed file. How do you specify the INDEX or KEY to the write command? Fortunately, I'm going to be writing records that start with a key of 1, then 2, then 3, and so forth and so on. I will then close this file and then use read/key (or read/index, which ever is the correct one) to read the line I need from this index file. I may read 100 records and then want to go back and read starting from the 10th record, and possibly skipping around the file. I want to do this in DCL. Any help would be appreciated.

~Jon.
Author RE: How can I create and write to an indexed file and then read from it in DCL?
Bruce Claremont
Member

Posts: 623
Joined: 07.01.10
Posted on August 03 2016 03:57
Look at EDIT/FDL to create the indexed file definition.

The key is determined by its position in the record. No key qualifier is needed on a WRITE command.

You'll want to review OPEN, CLOSE, READ, WRITE, EDIT/FDL, and CREATE/FDL in the DCL manual.
Author RE: How can I create and write to an indexed file and then read from it in DCL?
muddflapp
Member

Posts: 17
Location: Texas
Joined: 01.06.21
Posted on June 05 2021 07:26
The way I do it is to start with an FDL file that has multiple and different key types.
$ analyze/rms_file/fdl sys$system:sysuaf.dat
$ search sysuaf.fdl /out=test.fdl /match=nor IDENT,SYSUAF,OWNER,PROTECTION
$ delete sysuaf.fdl;
$! OK, now we have TEST.FDL that we can play with and not clobber SYSUAF.DAT
Modify TEST.FDL to say:
SIZE 1028
NAME "LINE"
SEG0_POSITION 0
SEG0_LENGTH 4
TYPE bin4
delete everything from "KEY 1" on down and save the file
$ create/fdl=test.fdl test.isam
$ key[0,32] = 0
$ text=f$fao("!512*-"
$ open/read/write/share file test.isam
$ read/key=&key/index=0 file record
%RMS-E-RNF, record not found
$ write/symbol file key,text1,text1
$ read/key=&key/index=0 file record
$ write sys$output f$length(record)
%DCL-W-BUFOVF, command buffer overflow - shorten expression or command line
$! DCL symbol record can't be longer than 1004 bytes with OpenVMS Alpha 8.4-2h2
$! Use a bonified programming language for longer than 1004 byte records

If SIZE was 1004 in TEST.FDL
I didn't modify it. I just wrote shorter records
$ text=f$fao("!510*+"smiley
$ read/index=0/key=&key file record
$ write/update/symbol key,text,text
$ read/index=0/key=&key/nolock file record
$ show sym record
RECORD = "....+++++++++++++++" etc,..
Author RE: How can I create and write to an indexed file and then read from it in DCL?
muddflapp
Member

Posts: 17
Location: Texas
Joined: 01.06.21
Posted on June 05 2021 08:35
I modified TEST.FDL
SIZE 516
DUPLICATES yes
$ create/fdl=TEST.FDL TEST.ISAM
$ open/read/write/share file TEST.ISAM

$ key0[0,32] = 0
$ key1[0,32] = 1
$ text0 = f$fao("!512*-"smiley
$ text1 = f$fao("!512*="smiley
$ text2 = f$fao("!512*+"smiley
$ lineout = "write sys$output f$fao(""!SW !UL !AS"", f$len(rec),f$cvui(0,32,rec),f$extr(4,10,rec))"

$ read/key=&key0 file rec
%RMS-E-EOF, end of file detected
$ write/symbol file key0,text0
$ write/symbol file key0,text1
$ write/symbol file key1,text1
$ write/symbol file key1,text0

$ read/nolock/key=&key0 file rec
$ lineout
516 0 ----------
$ read/nolock file rec
$ lineout
516 0 ==========
$ read/nolock file rec
$ lineout
516 1 ==========
$ read/nolock file rec
$ lineout
516 1 ----------
$ read/nolock file rec
%RMS-E-EOF, end of file detected

$ read/nolock/key=&key1 file rec
$ lineout
516 1 ==========
$ read/nolock file rec
$ lineout
516 1 ----------
$ read/nolock file rec
%RMS-E-EOF, end of file detected

$ read/key=&key1 file rec
$ lineout
516 1 ----------
$ write/symbol/update file key1,text2
$ read file rec
$ lineout
516 1 ==========
$ write/symbol/update file key1,text2

$ read/nolock/key=&key1 file rec
$ lineout
516 1 ++++++++++
$ read/nolock file rec
$ lineout
516 1 ++++++++++
$ read/nolock file rec
%RMS-E-EOF, end of file detected
Jump to Forum:
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Are you going to OpenVMS Boot Camp 2016?

Yes

No

You must login to vote.
Shoutbox
You must login to post a message.

malmberg
August 04 2022
No more VAX hobbyist licenses. Community licenses for Alpha/IA64/X86_64 VMS Software Inc. Commercial VMS software licenses for VAX available from HPE.

ozboomer
July 20 2022
Just re-visiting.. No more hobbyist licenses? Is that from vmssoftware.com, no 'community' licenses?

valdirfranco
July 01 2022
No more hobbyist license...sad

mister_wavey
February 12 2022
I recall that the disks failed on the public access VMS systems that included Fafner

parwezw
January 03 2022
Anyone know what happened to FAFNER.DYNDS.ORG? I had a hobbyist account here but can longer access the site.

gtackett
October 27 2021
Make that DECdfs _2.1A_ for Vax

gtackett
October 27 2021
I'm looking for DECdfs V2.4A kit for VAX. Asking here just in case anyone is still listening.

MarkRLV
September 17 2021
At one time, didn't this web site have a job board? I would love to use my legacy skills one last time in my career.

malmberg
January 18 2021
New Hobbyist PAKs for VAX/VMS are no longer available according to reports. Only commercial licenses are reported to be for sale from HPE

dfilip
January 16 2021
Can someone please point me to hobbyist license pak? I'm looking for VAX/VMS 7.1, DECnet Phase IV, and UCX/TCPIP ... have the 7.1 media, need the license paks ... thanks!

Bart
October 16 2020
OpenVMS, and this website!

malmberg
September 05 2020
VSI community non-commercial licenses for AXP/IA64 are available now.

malmberg
September 05 2020
See the forum about licensing. Don't know if HPE hobby licenses still being issued. Commercial licenses still being sold.

silfox70
September 01 2020
I need the license for OpenVMS7.3. Where can I find them?

malmberg
August 29 2020
Eisner, which is currently being moved, got an SSH update and the keys were updated to more modern encryption standards.

Shoutbox Archive