<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Relative record files not being read correctly in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393030#M16409</link>
    <description>Here are some of the file attributes.&lt;BR /&gt;&lt;BR /&gt;Record format:      Fixed length 12 byte records&lt;BR /&gt;&lt;BR /&gt;File organization:  Relative, maximum record number: 2147483647&lt;BR /&gt;&lt;BR /&gt;Let me know if you need more inputs.</description>
    <pubDate>Thu, 02 Apr 2009 04:21:32 GMT</pubDate>
    <dc:creator>SIddheswar Samant</dc:creator>
    <dc:date>2009-04-02T04:21:32Z</dc:date>
    <item>
      <title>Relative record files not being read correctly</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393029#M16408</link>
      <description>Hi,&lt;BR /&gt;  I am using OpenVMS V7.3-2.&lt;BR /&gt;&lt;BR /&gt;  I have an Relative Record file with 42712 records(1 header record).&lt;BR /&gt;&lt;BR /&gt;  I tried to read the file randomly using HP-COBOL. &lt;BR /&gt;  When I try to read with the record key value 96094, it retrieves the record with key value 41000.&lt;BR /&gt;  Infact as per documentation, this should return an invalid key file status of 23. &lt;BR /&gt;  Unfortunately it doesn't. I defined the key value as PIC 9(09) COMP.&lt;BR /&gt;&lt;BR /&gt;  Let me know if this is a bug with HP COBOL or is it something I am missing.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Sid.&lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Thu, 02 Apr 2009 04:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393029#M16408</guid>
      <dc:creator>SIddheswar Samant</dc:creator>
      <dc:date>2009-04-02T04:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Relative record files not being read correctly</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393030#M16409</link>
      <description>Here are some of the file attributes.&lt;BR /&gt;&lt;BR /&gt;Record format:      Fixed length 12 byte records&lt;BR /&gt;&lt;BR /&gt;File organization:  Relative, maximum record number: 2147483647&lt;BR /&gt;&lt;BR /&gt;Let me know if you need more inputs.</description>
      <pubDate>Thu, 02 Apr 2009 04:21:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393030#M16409</guid>
      <dc:creator>SIddheswar Samant</dc:creator>
      <dc:date>2009-04-02T04:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Relative record files not being read correctly</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393031#M16410</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;This is OpenVMS.&lt;BR /&gt;There are no bugs in basic operations.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There is a problem in the program,&lt;BR /&gt;a lack of understanding, or both.&lt;BR /&gt;&lt;BR /&gt;Check the START verb for the file.&lt;BR /&gt;&lt;BR /&gt;Below a working example.&lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;$ cre rel.fdl&lt;BR /&gt;file; org rel;&lt;BR /&gt;reco; form fix; size 12;&lt;BR /&gt;$ conver/trun/pad/stat/fdl=rel sys$library:vms$password_dictionary.data tmp.rel&lt;BR /&gt;... Total Valid Records:           42979&lt;BR /&gt;$&lt;BR /&gt;$ run RELATIVE&lt;BR /&gt;Key value:000000005&lt;BR /&gt;abandon&lt;BR /&gt;Key value:000000505&lt;BR /&gt;adjustment&lt;BR /&gt;Key value:000050505&lt;BR /&gt;Key : 000050505 is not valid in the file.&lt;BR /&gt;Key value:000040505&lt;BR /&gt;unnameable&lt;BR /&gt;Key value:&lt;BR /&gt;&lt;BR /&gt;If you remove the "INVALID KEY" clause, then it will report:&lt;BR /&gt;File status 23 STS=000098994 STV=000000000&lt;BR /&gt;$ exit 0098994&lt;BR /&gt;%RMS-E-RNF, record not found&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IDENTIFICATION DIVISION.&lt;BR /&gt;PROGRAM-ID. HEIN.&lt;BR /&gt;ENVIRONMENT DIVISION.&lt;BR /&gt;INPUT-OUTPUT SECTION.&lt;BR /&gt;FILE-CONTROL.&lt;BR /&gt;    SELECT THE-FILE&lt;BR /&gt;        ASSIGN TO "TEST"&lt;BR /&gt;        ACCESS MODE IS DYNAMIC RELATIVE KEY IS rel_key&lt;BR /&gt;        ORGANIZATION IS RELATIVE&lt;BR /&gt;        FILE STATUS IS FILE-STATUS.&lt;BR /&gt;DATA DIVISION.&lt;BR /&gt;FILE SECTION.&lt;BR /&gt;FD THE-FILE.&lt;BR /&gt;01 THE-RECORD.&lt;BR /&gt;    03  SOME-DATA PIC X(12).&lt;BR /&gt;WORKING-STORAGE SECTION.&lt;BR /&gt;01  rel_key     PIC 9(9) COMP.&lt;BR /&gt;01  FILE-STATUS PIC XX.&lt;BR /&gt;01  STS         PIC 9(9).&lt;BR /&gt;01  STV         PIC 9(9).&lt;BR /&gt;01  the-key     PIC 9(9).&lt;BR /&gt;&lt;BR /&gt;PROCEDURE DIVISION.&lt;BR /&gt;&lt;BR /&gt;DECLARATIVES.&lt;BR /&gt;ERROR-HANDLER SECTION.&lt;BR /&gt;    USE AFTER STANDARD EXCEPTION PROCEDURE ON THE-FILE.&lt;BR /&gt;HERE-WE-GO.&lt;BR /&gt;    MOVE RMS-STS TO STS.&lt;BR /&gt;    MOVE RMS-STV TO STV.&lt;BR /&gt;    DISPLAY     "File status ", FILE-STATUS, " STS=", STS, " STV=", STV.&lt;BR /&gt;END DECLARATIVES.&lt;BR /&gt;&lt;BR /&gt;MAIN-CONTROL SECTION.&lt;BR /&gt;BEGIN-HERE.&lt;BR /&gt;        OPEN I-O THE-FILE ALLOWING ALL.&lt;BR /&gt;THE-LOOP.&lt;BR /&gt;        DISPLAY "Key value:" WITH NO ADVANCING.&lt;BR /&gt;        ACCEPT THE-KEY AT END STOP RUN.&lt;BR /&gt;        MOVE the-key TO rel_key.&lt;BR /&gt;        START THE-FILE KEY IS EQUAL TO rel_key&lt;BR /&gt;          INVALID KEY&lt;BR /&gt;            DISPLAY "Key : ", the-key, " is not valid in the file."&lt;BR /&gt;            GO TO the-loop.&lt;BR /&gt;        READ THE-FILE RECORD&lt;BR /&gt;        DISPLAY SOME-DATA.&lt;BR /&gt;        GO TO THE-LOOP.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Apr 2009 12:44:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/relative-record-files-not-being-read-correctly/m-p/4393031#M16410</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-04-02T12:44:56Z</dc:date>
    </item>
  </channel>
</rss>

