<?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 syntax for index file with multiple keys and each key have multiple columns in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/syntax-for-index-file-with-multiple-keys-and-each-key-have/m-p/7015852#M104360</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have index file with 100 columns and 3 keys. each key have mulltiple columns at random positions from file.&lt;/P&gt;&lt;P&gt;example: index.dat K1, K2 and K3. columns: C1,C2,C3,C4....C100.&lt;/P&gt;&lt;P&gt;K1 - C10,C11,C12,C13 K2 - C9,C10,C11,C12,C13,C14&amp;nbsp; K3 - C5,C40&lt;/P&gt;&lt;P&gt;i tried to read this index file thru COBOL program as below:&lt;/P&gt;&lt;P&gt;I-O section: SELECT index orgnaization is indexed record key is K1 alternate key is K2 alternate key is K3&lt;/P&gt;&lt;P&gt;Data section:&lt;/P&gt;&lt;P&gt;FD index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 k1.&lt;/P&gt;&lt;P&gt;05 C10&lt;/P&gt;&lt;P&gt;05 C11&lt;/P&gt;&lt;P&gt;05 C12&lt;/P&gt;&lt;P&gt;05 C13&lt;/P&gt;&lt;P&gt;01 k2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 C9&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 C10&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;05 C11 ---&lt;/P&gt;&lt;P&gt;01 K3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;05 C5&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;05 C40&lt;/P&gt;&lt;P&gt;01 index-rec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c2 .....&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;I-O section: SELECT index orgnaization is indexed record key is&amp;nbsp;C10,C11,C12.. alternate key is&amp;nbsp;C9,C10...&amp;nbsp;alternate key is&amp;nbsp;C9, C40&lt;/P&gt;&lt;P&gt;Data section:&lt;/P&gt;&lt;P&gt;FD index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 index-rec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c2 .....&lt;/P&gt;&lt;P&gt;i am getting error in both cases with error as " attempting to open indexed file index.dat whose actuals keys don't match" while opening file statement in debug the code.&lt;/P&gt;&lt;P&gt;i tried to find syntax or example in multiple websites but most of them has single key or multiple key also with each key has one column and that too first rows not from random columns.&lt;/P&gt;&lt;P&gt;Please help me how to resolve this issue and help in delcaration on file?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 14:21:02 GMT</pubDate>
    <dc:creator>sureshso</dc:creator>
    <dc:date>2018-08-24T14:21:02Z</dc:date>
    <item>
      <title>syntax for index file with multiple keys and each key have multiple columns</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/syntax-for-index-file-with-multiple-keys-and-each-key-have/m-p/7015852#M104360</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have index file with 100 columns and 3 keys. each key have mulltiple columns at random positions from file.&lt;/P&gt;&lt;P&gt;example: index.dat K1, K2 and K3. columns: C1,C2,C3,C4....C100.&lt;/P&gt;&lt;P&gt;K1 - C10,C11,C12,C13 K2 - C9,C10,C11,C12,C13,C14&amp;nbsp; K3 - C5,C40&lt;/P&gt;&lt;P&gt;i tried to read this index file thru COBOL program as below:&lt;/P&gt;&lt;P&gt;I-O section: SELECT index orgnaization is indexed record key is K1 alternate key is K2 alternate key is K3&lt;/P&gt;&lt;P&gt;Data section:&lt;/P&gt;&lt;P&gt;FD index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 k1.&lt;/P&gt;&lt;P&gt;05 C10&lt;/P&gt;&lt;P&gt;05 C11&lt;/P&gt;&lt;P&gt;05 C12&lt;/P&gt;&lt;P&gt;05 C13&lt;/P&gt;&lt;P&gt;01 k2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 C9&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 C10&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;05 C11 ---&lt;/P&gt;&lt;P&gt;01 K3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;05 C5&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;05 C40&lt;/P&gt;&lt;P&gt;01 index-rec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c2 .....&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;I-O section: SELECT index orgnaization is indexed record key is&amp;nbsp;C10,C11,C12.. alternate key is&amp;nbsp;C9,C10...&amp;nbsp;alternate key is&amp;nbsp;C9, C40&lt;/P&gt;&lt;P&gt;Data section:&lt;/P&gt;&lt;P&gt;FD index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 index-rec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c2 .....&lt;/P&gt;&lt;P&gt;i am getting error in both cases with error as " attempting to open indexed file index.dat whose actuals keys don't match" while opening file statement in debug the code.&lt;/P&gt;&lt;P&gt;i tried to find syntax or example in multiple websites but most of them has single key or multiple key also with each key has one column and that too first rows not from random columns.&lt;/P&gt;&lt;P&gt;Please help me how to resolve this issue and help in delcaration on file?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:21:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/syntax-for-index-file-with-multiple-keys-and-each-key-have/m-p/7015852#M104360</guid>
      <dc:creator>sureshso</dc:creator>
      <dc:date>2018-08-24T14:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: syntax for index file with multiple keys and each key have multiple columns</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/syntax-for-index-file-with-multiple-keys-and-each-key-have/m-p/7015878#M104364</link>
      <description>&lt;P&gt;Just do not specify the alternate keys if you do not need the,&lt;/P&gt;&lt;P&gt;If you specify them, then Cobol ensures they are matching the file.&lt;/P&gt;&lt;P&gt;If you leave them out, there is nothing to check, nothing to fail.&lt;/P&gt;&lt;P&gt;If you are just processing from first to last (as suggested by other posts here) then you casn probably even leave of the primary key if my recollection is correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most importantly you do NOT specify those K1 and K2 thingies. Those are just names/labels for a collection of columns.&lt;/P&gt;&lt;P&gt;Get rid of...&lt;/P&gt;&lt;P&gt;FD index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 k1.&lt;/P&gt;&lt;P&gt;05 C10...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only use...&lt;/P&gt;&lt;P&gt;01 index-rec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 05 c2 .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or... do NOTHING, after CONVERTING the file to sequential as per other topic&lt;/P&gt;&lt;P&gt;(CONVERT/FDL=NL: /STAT idx.dat seq.dat)&lt;/P&gt;&lt;P&gt;The bits/record-layout will be the same, just no indexes, and just read as a sequential file.&lt;/P&gt;&lt;P&gt;And oh.... RTFM :&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example: HP COBOL UserManual Order Number: AA–Q2G1H–TK January 2005&lt;/P&gt;&lt;P&gt;Processing Files and Records 6.3 Creating and Processing Files&lt;/P&gt;&lt;P&gt;Example 6–26 Creating and Populating an Indexed File&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Hein.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 20:13:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/syntax-for-index-file-with-multiple-keys-and-each-key-have/m-p/7015878#M104364</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2018-08-24T20:13:11Z</dc:date>
    </item>
  </channel>
</rss>

