<?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: COBOL file open problem in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830910#M34459</link>
    <description>If the program was compiled with the /CHECK=DUPLICATE_KEYS qualifier on the command line, and the duplicate key specification on a file's FD (in other words, specified in the WITH DUPLICATES phrase) does not match that of the actual file, a run-time diagnostic will be issued when an attempt is made to open the file with an OPEN statement. &lt;BR /&gt;&lt;BR /&gt;Did you specify /check or /check=all or /check=dup ?&lt;BR /&gt;&lt;BR /&gt;Wim&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Jul 2006 05:52:08 GMT</pubDate>
    <dc:creator>Wim Van den Wyngaert</dc:creator>
    <dc:date>2006-07-26T05:52:08Z</dc:date>
    <item>
      <title>COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830908#M34457</link>
      <description>&lt;!--!*#--&gt;I have recently recompiled a very old program and on execution, I get the following error:&lt;BR /&gt;&lt;BR /&gt;%COB-F-KEYNOTMAT, attempting to open indexed file PROG_ROOT:[RAWALH.RMG.REVAL.TR&lt;BR /&gt;IBALSEL]XTAMST.DAT;3 whose actual keys do not match those declared&lt;BR /&gt;&lt;BR /&gt;as far as I understand, this means that the file has more or less keys than have been declared in the program.&lt;BR /&gt;&lt;BR /&gt;The program was last compiled in 1991 and the previously created executable works fine.  When recompiling the source, I get a different sized EXE, which does not inpire confidence.&lt;BR /&gt;&lt;BR /&gt;I have done an ANALYZE/RMS/FDL and compared against the original FDL (created in 1989) and there do not appear to be any changes there.&lt;BR /&gt;&lt;BR /&gt;FDL&lt;BR /&gt;&lt;BR /&gt;IDENT "26-JUL-2006 10:30:47    OpenVMS ANALYZE/RMS_FILE Utility"&lt;BR /&gt;&lt;BR /&gt;SYSTEM&lt;BR /&gt;      SOURCE                  OpenVMS&lt;BR /&gt;&lt;BR /&gt;FILE&lt;BR /&gt;      ALLOCATION              630&lt;BR /&gt;      BEST_TRY_CONTIGUOUS     no&lt;BR /&gt;      BUCKET_SIZE             2&lt;BR /&gt;      CLUSTER_SIZE            35&lt;BR /&gt;      CONTIGUOUS              no&lt;BR /&gt;      EXTENSION               0&lt;BR /&gt;      FILE_MONITORING         no&lt;BR /&gt;      GLOBAL_BUFFER_COUNT     0&lt;BR /&gt;      NAME                    "PROG_ROOT:[RAWALH.RMG.REVAL.TRIBALSEL]XTAMST.DA&lt;BR /&gt;T;2"&lt;BR /&gt;      ORGANIZATION            indexed&lt;BR /&gt;      OWNER                   [30,*]&lt;BR /&gt;      PROTECTION              (system:RWED, owner:RWED, group:RWE, world:)&lt;BR /&gt;&lt;BR /&gt;RECORD&lt;BR /&gt;      BLOCK_SPAN              yes&lt;BR /&gt;      CARRIAGE_CONTROL        carriage_return&lt;BR /&gt;      FORMAT                  fixed&lt;BR /&gt;      SIZE                    34&lt;BR /&gt;&lt;BR /&gt;AREA 0&lt;BR /&gt;      ALLOCATION              560&lt;BR /&gt;      BUCKET_SIZE             2&lt;BR /&gt;      EXTENSION               0&lt;BR /&gt;&lt;BR /&gt;KEY 0&lt;BR /&gt;      CHANGES                 no&lt;BR /&gt;      DATA_KEY_COMPRESSION    yes&lt;BR /&gt;      DATA_RECORD_COMPRESSION yes&lt;BR /&gt;      DATA_AREA               0&lt;BR /&gt;      DATA_FILL               100&lt;BR /&gt;      DUPLICATES              no&lt;BR /&gt;      INDEX_AREA              0&lt;BR /&gt;      INDEX_COMPRESSION       yes&lt;BR /&gt;      INDEX_FILL              100&lt;BR /&gt;      LEVEL1_INDEX_AREA       0&lt;BR /&gt;      NAME                    "XTA-KEY"&lt;BR /&gt;      NULL_KEY                no&lt;BR /&gt;      PROLOG                  3&lt;BR /&gt;      SEG0_LENGTH             22&lt;BR /&gt;      SEG0_POSITION           0&lt;BR /&gt;      TYPE                    string&lt;BR /&gt;&lt;BR /&gt;KEY 1&lt;BR /&gt;      CHANGES                 yes&lt;BR /&gt;      DATA_KEY_COMPRESSION    yes&lt;BR /&gt;      DATA_AREA               0&lt;BR /&gt;      DATA_FILL               100&lt;BR /&gt;      DUPLICATES              yes&lt;BR /&gt;      INDEX_AREA              0&lt;BR /&gt;      INDEX_COMPRESSION       yes&lt;BR /&gt;      INDEX_FILL              100&lt;BR /&gt;      LEVEL1_INDEX_AREA       0&lt;BR /&gt;      NAME                    "GLNO"&lt;BR /&gt;      NULL_KEY                yes&lt;BR /&gt;      NULL_VALUE              32&lt;BR /&gt;      SEG0_LENGTH             6&lt;BR /&gt;      SEG0_POSITION           28&lt;BR /&gt;      TYPE                    string&lt;BR /&gt;&lt;BR /&gt;ANALYSIS_OF_AREA 0&lt;BR /&gt;      RECLAIMED_SPACE         0&lt;BR /&gt;&lt;BR /&gt;ANALYSIS_OF_KEY 0&lt;BR /&gt;      DATA_FILL               82&lt;BR /&gt;      DATA_KEY_COMPRESSION    58&lt;BR /&gt;      DATA_RECORD_COMPRESSION -8&lt;BR /&gt;      DATA_RECORD_COUNT       4687&lt;BR /&gt;      DATA_SPACE_OCCUPIED     392&lt;BR /&gt;      DEPTH                   2&lt;BR /&gt;      INDEX_COMPRESSION       14&lt;BR /&gt;      INDEX_FILL              52&lt;BR /&gt;      INDEX_SPACE_OCCUPIED    16&lt;BR /&gt;      LEVEL1_RECORD_COUNT     196&lt;BR /&gt;      MEAN_DATA_LENGTH        34&lt;BR /&gt;      MEAN_INDEX_LENGTH       24&lt;BR /&gt;&lt;BR /&gt;ANALYSIS_OF_KEY 1&lt;BR /&gt;      DATA_FILL               75&lt;BR /&gt;      DATA_KEY_COMPRESSION    44&lt;BR /&gt;      DATA_RECORD_COUNT       2889&lt;BR /&gt;      DATA_SPACE_OCCUPIED     126&lt;BR /&gt;      DEPTH                   1&lt;BR /&gt;      DUPLICATES_PER_SIDR     1&lt;BR /&gt;      INDEX_COMPRESSION       11&lt;BR /&gt;      INDEX_FILL              44&lt;BR /&gt;      INDEX_SPACE_OCCUPIED    2&lt;BR /&gt;      LEVEL1_RECORD_COUNT     62&lt;BR /&gt;      MEAN_DATA_LENGTH        17&lt;BR /&gt;      MEAN_INDEX_LENGTH       8&lt;BR /&gt;&lt;BR /&gt;(two keys defined)&lt;BR /&gt;&lt;BR /&gt;The file is declared as follows:&lt;BR /&gt;&lt;BR /&gt;    SELECT XTAMST           ASSIGN TO "XTAMST"&lt;BR /&gt;           ACCESS           DYNAMIC&lt;BR /&gt;           ORGANIZATION     INDEXED&lt;BR /&gt;           RECORD KEY       XTA-KEY&lt;BR /&gt;           ALTERNATE RECORD XTA-GLNO.&lt;BR /&gt;&lt;BR /&gt;(two keys)&lt;BR /&gt;&lt;BR /&gt;The record description is as follows:&lt;BR /&gt;&lt;BR /&gt;   01  XTA-REC.&lt;BR /&gt;       03  XTA-KEY.&lt;BR /&gt;           05  XTA-ACTYPE           PIC 9(2).&lt;BR /&gt;           05  XTA-BOOK             PIC X(4).&lt;BR /&gt;           05  XTA-PRODUCT          PIC 9(2).&lt;BR /&gt;           05  XTA-PAID-RCVD        PIC X.&lt;BR /&gt;           05  XTA-CTYPE            PIC 9(2).&lt;BR /&gt;           05  XTA-HDG-UNHDG        PIC X.&lt;BR /&gt;           05  XTA-LOCO             PIC X(4).&lt;BR /&gt;           05  XTA-CUR-METAL        PIC X.&lt;BR /&gt;           05  XTA-CHARGE-TYPE      PIC 9(2).&lt;BR /&gt;           05  XTA-CONTRA-CUR       PIC X(3).&lt;BR /&gt;       03  FILLER                   PIC X(6).&lt;BR /&gt;       03  XTA-SEC-KEY.&lt;BR /&gt;           05  XTA-GLNO             PIC 9(6).&lt;BR /&gt;&lt;BR /&gt;Does anybody know why the program fails to open the file?&lt;BR /&gt;&lt;BR /&gt;A host of other program also use this file and have not had the same error after recompilation?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Hitesh</description>
      <pubDate>Wed, 26 Jul 2006 04:41:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830908#M34457</guid>
      <dc:creator>Hitesh Rawal</dc:creator>
      <dc:date>2006-07-26T04:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830909#M34458</link>
      <description>You probably compiled with different alignment options than the original.&lt;BR /&gt;Compile with /list/map=declared qualifiers,&lt;BR /&gt;then compare the fdl and the map of the record definition.&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 04:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830909#M34458</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2006-07-26T04:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830910#M34459</link>
      <description>If the program was compiled with the /CHECK=DUPLICATE_KEYS qualifier on the command line, and the duplicate key specification on a file's FD (in other words, specified in the WITH DUPLICATES phrase) does not match that of the actual file, a run-time diagnostic will be issued when an attempt is made to open the file with an OPEN statement. &lt;BR /&gt;&lt;BR /&gt;Did you specify /check or /check=all or /check=dup ?&lt;BR /&gt;&lt;BR /&gt;Wim&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 05:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830910#M34459</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2006-07-26T05:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830911#M34460</link>
      <description>Hello Hitesh,&lt;BR /&gt;&lt;BR /&gt;Let me first compliment you on such a well documented question: An actual error message, sources, relevant environment data. Refreshing!&lt;BR /&gt;&lt;BR /&gt;Ok, the compiler and OS version details are missing, but this is just amongst friends, not a support call.&lt;BR /&gt;&lt;BR /&gt;Anyway... &lt;BR /&gt;&lt;BR /&gt;At first glance the key definitions in the cobol seem to match the relevant FDL data (position, size, type)&lt;BR /&gt;The FDL has a NULL key defined, which cobol can not define, but that will not cause a mismatch.&lt;BR /&gt;&lt;BR /&gt;Maybe the duplicates on KEY 1?&lt;BR /&gt;&lt;BR /&gt;Like Phil wrote, alignment comes to mind, but the record does nto seem to have comp fields. CHeck the listing to be sure.&lt;BR /&gt;&lt;BR /&gt;My advice would be to temporarely change the open to OPEN FOR OUTPUT and have Cobol create the file, then compare the FDL's.&lt;BR /&gt;&lt;BR /&gt;Further free advice: Tune that FDL!&lt;BR /&gt;- Disable record compression (its effect is negative)&lt;BR /&gt;- Drop this index compression (faster lookup)&lt;BR /&gt;- Pick a bucket size larger than 4 (8?) to drop the primary key index a level.&lt;BR /&gt;- Convert&lt;BR /&gt;&lt;BR /&gt;Good luck,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 06:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830911#M34460</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-26T06:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830912#M34461</link>
      <description>Thanks everyone.&lt;BR /&gt;&lt;BR /&gt;The problem was due to /CHECK=ALL parameter on the compile.&lt;BR /&gt;&lt;BR /&gt;We have compile/link command procedures and these were created in 2004, hence original compile was probably from the command line. &lt;BR /&gt;&lt;BR /&gt;I have now added the WITH DUPLICATES onto the declaration i.e.:&lt;BR /&gt;&lt;BR /&gt;SELECT XTAMST           ASSIGN TO "XTAMST"&lt;BR /&gt;           ACCESS           DYNAMIC&lt;BR /&gt;           ORGANIZATION     INDEXED&lt;BR /&gt;           RECORD KEY       XTA-KEY&lt;BR /&gt;           ALTERNATE RECORD XTA-GLNO&lt;BR /&gt;                  WITH DUPLICATES.&lt;BR /&gt;&lt;BR /&gt;and all is well.&lt;BR /&gt;&lt;BR /&gt;Once again thanks for all your help.&lt;BR /&gt;Points submission to follow.&lt;BR /&gt;&lt;BR /&gt;Hitesh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 06:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830912#M34461</guid>
      <dc:creator>Hitesh Rawal</dc:creator>
      <dc:date>2006-07-26T06:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830913#M34462</link>
      <description>perhaps it uses a compiler option that causes it to check the name of the secondary key? I always thought this was for reference only.&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 06:49:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830913#M34462</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2006-07-26T06:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830914#M34463</link>
      <description>To my knowledge, your data items will not be realligned. Only comp etc fields are.&lt;BR /&gt;&lt;BR /&gt;Do not forget to check the already compiled programs. They might encounter the same problem after a conditional statement.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 26 Jul 2006 06:57:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830914#M34463</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2006-07-26T06:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL file open problem</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830915#M34464</link>
      <description>The compiler option /CHECK=ALL is used.  &lt;BR /&gt;&lt;BR /&gt;As the secondary key has a duplicates = yes, this must be defined in the SELECT.&lt;BR /&gt;&lt;BR /&gt;VMS Help on COBOL/CHECK :&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;COBOL&lt;BR /&gt;&lt;BR /&gt;  /CHECK&lt;BR /&gt;&lt;BR /&gt;     /CHECK[=(option[,...])]&lt;BR /&gt;     /NOCHECK                 (D)&lt;BR /&gt;&lt;BR /&gt;Specifies conditions to be checked at execution  time.   Controls whether   the   system   checks   PERFORM   statements,  indexes,  subscripts, reference modifications, the  depending-item  and&lt;BR /&gt;indexed file keys for specific run-time errors.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt; [NO]DUPLICATE_KEYS&lt;BR /&gt;      Verifies that the duplicate key &lt;BR /&gt;      specification for indexed file keys &lt;BR /&gt;      in the source program matches&lt;BR /&gt;      the duplicate key specification &lt;BR /&gt;      in the physical file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;As the WITH DUPLICATES was not specified, at runtime there was a mismatch between the programs definition of the file indexes and the file indexes themselves.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jul 2006 07:01:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-file-open-problem/m-p/3830915#M34464</guid>
      <dc:creator>Hitesh Rawal</dc:creator>
      <dc:date>2006-07-26T07:01:29Z</dc:date>
    </item>
  </channel>
</rss>

