HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Relative record files not being read correctly
Operating System - OpenVMS
1827793
Members
2337
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2009 09:16 PM
04-01-2009 09:16 PM
Relative record files not being read correctly
Hi,
I am using OpenVMS V7.3-2.
I have an Relative Record file with 42712 records(1 header record).
I tried to read the file randomly using HP-COBOL.
When I try to read with the record key value 96094, it retrieves the record with key value 41000.
Infact as per documentation, this should return an invalid key file status of 23.
Unfortunately it doesn't. I defined the key value as PIC 9(09) COMP.
Let me know if this is a bug with HP COBOL or is it something I am missing.
Thanks
Sid.
I am using OpenVMS V7.3-2.
I have an Relative Record file with 42712 records(1 header record).
I tried to read the file randomly using HP-COBOL.
When I try to read with the record key value 96094, it retrieves the record with key value 41000.
Infact as per documentation, this should return an invalid key file status of 23.
Unfortunately it doesn't. I defined the key value as PIC 9(09) COMP.
Let me know if this is a bug with HP COBOL or is it something I am missing.
Thanks
Sid.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2009 09:21 PM
04-01-2009 09:21 PM
Re: Relative record files not being read correctly
Here are some of the file attributes.
Record format: Fixed length 12 byte records
File organization: Relative, maximum record number: 2147483647
Let me know if you need more inputs.
Record format: Fixed length 12 byte records
File organization: Relative, maximum record number: 2147483647
Let me know if you need more inputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 05:44 AM
04-02-2009 05:44 AM
Re: Relative record files not being read correctly
This is OpenVMS.
There are no bugs in basic operations.
There is a problem in the program,
a lack of understanding, or both.
Check the START verb for the file.
Below a working example.
Hth,
Hein.
$ cre rel.fdl
file; org rel;
reco; form fix; size 12;
$ conver/trun/pad/stat/fdl=rel sys$library:vms$password_dictionary.data tmp.rel
... Total Valid Records: 42979
$
$ run RELATIVE
Key value:000000005
abandon
Key value:000000505
adjustment
Key value:000050505
Key : 000050505 is not valid in the file.
Key value:000040505
unnameable
Key value:
If you remove the "INVALID KEY" clause, then it will report:
File status 23 STS=000098994 STV=000000000
$ exit 0098994
%RMS-E-RNF, record not found
IDENTIFICATION DIVISION.
PROGRAM-ID. HEIN.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT THE-FILE
ASSIGN TO "TEST"
ACCESS MODE IS DYNAMIC RELATIVE KEY IS rel_key
ORGANIZATION IS RELATIVE
FILE STATUS IS FILE-STATUS.
DATA DIVISION.
FILE SECTION.
FD THE-FILE.
01 THE-RECORD.
03 SOME-DATA PIC X(12).
WORKING-STORAGE SECTION.
01 rel_key PIC 9(9) COMP.
01 FILE-STATUS PIC XX.
01 STS PIC 9(9).
01 STV PIC 9(9).
01 the-key PIC 9(9).
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.
THE-LOOP.
DISPLAY "Key value:" WITH NO ADVANCING.
ACCEPT THE-KEY AT END STOP RUN.
MOVE the-key TO rel_key.
START THE-FILE KEY IS EQUAL TO rel_key
INVALID KEY
DISPLAY "Key : ", the-key, " is not valid in the file."
GO TO the-loop.
READ THE-FILE RECORD
DISPLAY SOME-DATA.
GO TO THE-LOOP.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP