<?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: Defining an indexed FD for two different files. in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609698#M39704</link>
    <description>Maybe I'm doing something wrong but I have a file stat 39 when I try to open the file, this file (on one server) is define as follows:&lt;BR /&gt;&lt;BR /&gt;File organization:  Indexed, Prolog: 3, Using 1 key&lt;BR /&gt;                             In 2 areas&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 70, Extend: 12, Maximum bucket size: 12&lt;BR /&gt;                    Global buffer count: 0, No version limit&lt;BR /&gt;                    Contiguous best try&lt;BR /&gt;Record format:      Fixed length 37 byte records&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And the other is define exactly the same but "Fixed length 42 byte records" and they MUST be like this. Am I doing something wrong or it is simply not possible?</description>
    <pubDate>Wed, 31 Mar 2010 08:03:40 GMT</pubDate>
    <dc:creator>Yyrkoon</dc:creator>
    <dc:date>2010-03-31T08:03:40Z</dc:date>
    <item>
      <title>Defining an indexed FD for two different files.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609696#M39702</link>
      <description>&lt;BR /&gt;Hi all,&lt;BR /&gt;I have a problem trying to define a FD indexed file. The problem is that I have two different systems and two different indexed files with diffent length, one on each system. I would like to developed a single program able to read from this file on both systems and I want to define just one FD.&lt;BR /&gt;&lt;BR /&gt;I mean, something like (I am guessing 100%):&lt;BR /&gt;&lt;BR /&gt;FD navigator&lt;BR /&gt;Organization is indexed&lt;BR /&gt;File status is file-stat&lt;BR /&gt;Record contains 15 OR 20 characters depending on wk-system&lt;BR /&gt;Access mode is dynamic.&lt;BR /&gt;01 wk-system1  pic X(15).&lt;BR /&gt;01 wk-system2  pic X(20).&lt;BR /&gt;&lt;BR /&gt;Can I do this somehow?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;Yyrkoon.</description>
      <pubDate>Tue, 30 Mar 2010 13:38:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609696#M39702</guid>
      <dc:creator>Yyrkoon</dc:creator>
      <dc:date>2010-03-30T13:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Defining an indexed FD for two different files.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609697#M39703</link>
      <description>You need to use either &lt;BR /&gt;RECORD CONTAINS xxx TO xx CHARACTERS&lt;BR /&gt;or&lt;BR /&gt;RECORD IS VARYING IN SIZE FROM xx [ TO xx ] CHARACTERS DEPENDING on depending-name.&lt;BR /&gt;&lt;BR /&gt;Next you declare your record with  REDEFINE clause.&lt;BR /&gt;For files, you can NOT do those at 01 level.&lt;BR /&gt;If you'd try then you would get the message:&lt;BR /&gt;&lt;BR /&gt;%COBOL-E-FILSECRED, REDEFINES clause invalid for 01 level data item in FILE SECTION - clause accepted&lt;BR /&gt;&lt;BR /&gt;So you'll have to add a bonus level just for that.&lt;BR /&gt;&lt;BR /&gt;The FD might end up looking something like:&lt;BR /&gt;&lt;BR /&gt;FD THE-FILE external.&lt;BR /&gt;01 all-blah.&lt;BR /&gt; 02 blah.&lt;BR /&gt;  03 catch-all pic x(200).&lt;BR /&gt; 02 redefines blah.&lt;BR /&gt;  03 wk-system1  pic X(15).&lt;BR /&gt; 02 redefines blah.&lt;BR /&gt;  03 wk-system2  pic X(20).&lt;BR /&gt;&lt;BR /&gt;For READING the depending on item will be SET, giving you an indication which flavor of record you read.&lt;BR /&gt;&lt;BR /&gt;For WRITING you'll have to set the correct matching length.&lt;BR /&gt;&lt;BR /&gt;More often than not there will be a flag field early in the record in indicate the flavor as well.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Mar 2010 14:18:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609697#M39703</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-03-30T14:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Defining an indexed FD for two different files.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609698#M39704</link>
      <description>Maybe I'm doing something wrong but I have a file stat 39 when I try to open the file, this file (on one server) is define as follows:&lt;BR /&gt;&lt;BR /&gt;File organization:  Indexed, Prolog: 3, Using 1 key&lt;BR /&gt;                             In 2 areas&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 70, Extend: 12, Maximum bucket size: 12&lt;BR /&gt;                    Global buffer count: 0, No version limit&lt;BR /&gt;                    Contiguous best try&lt;BR /&gt;Record format:      Fixed length 37 byte records&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And the other is define exactly the same but "Fixed length 42 byte records" and they MUST be like this. Am I doing something wrong or it is simply not possible?</description>
      <pubDate>Wed, 31 Mar 2010 08:03:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609698#M39704</guid>
      <dc:creator>Yyrkoon</dc:creator>
      <dc:date>2010-03-31T08:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Defining an indexed FD for two different files.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609699#M39705</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; Maybe I'm doing something wrong but I have a file stat 39 when I try to open the file&lt;BR /&gt;&lt;BR /&gt;I suspect you are doing something wrong, but since you did not show relevant (fragments of the) code it is hard to guess what.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; this file (on one server) is define as follows:&lt;BR /&gt;&lt;BR /&gt;File organization: Indexed, Prolog: 3, Using 1 key&lt;BR /&gt;Record format: Fixed length 37 byte records&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; And the other is define exactly the same but "Fixed length 42 byte records" and they MUST be like this. &lt;BR /&gt;&lt;BR /&gt;Must is such a seemingly strong word.&lt;BR /&gt;It probably just means "we don't understand enough of the system to change this", or "we can not jsutify the cost of changing that, just to resolve the current issue"&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Am I doing something wrong or it is simply not possible?&lt;BR /&gt;&lt;BR /&gt;It works for me, so my money is on the first choice.&lt;BR /&gt;Here is what works for me...&lt;BR /&gt;&lt;BR /&gt;OpenVMS V8.2, Alpha DS20, Compaq COBOL V2.8-1286&lt;BR /&gt;&lt;BR /&gt;:&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;        RECORD KEY IS THE-KEY&lt;BR /&gt;        ACCESS MODE IS DYNAMIC&lt;BR /&gt;        ORGANIZATION IS INDEXED&lt;BR /&gt;        FILE STATUS IS FILE-STATUS.&lt;BR /&gt;:&lt;BR /&gt;FD THE-FILE&lt;BR /&gt;         RECORD IS VARYING IN SIZE FROM 4 CHARACTERS DEPENDING on depending-name.&lt;BR /&gt;01 THE-RECORD.&lt;BR /&gt;    03  THE-KEY PIC X(4).&lt;BR /&gt;    03  SOME-DATA PIC X(66).&lt;BR /&gt;:&lt;BR /&gt;WORKING-STORAGE SECTION.&lt;BR /&gt;01  depending-name PIC 9(9) COMP.&lt;BR /&gt;01  FILE-STATUS PIC XX.&lt;BR /&gt;:&lt;BR /&gt;        READ THE-FILE RECORD KEY IS THE-KEY.&lt;BR /&gt;        DISPLAY depending-name WITH CONVERSION.&lt;BR /&gt;&lt;BR /&gt;As input file I used:&lt;BR /&gt;$ conver tt: test.dat /fdl="file; org ind; rec; form fixed; size 70; key 0; seg0_l 4"/pad="7"&lt;BR /&gt;aap&lt;BR /&gt;mies&lt;BR /&gt;noot&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;&lt;BR /&gt;$ conver tt: test.dat /fdl="file; org ind; rec; form fixed; size 60; key 0; seg0_l 4"/pad="6"&lt;BR /&gt;Created:    31-MAR-2010 06:29:22.40&lt;BR /&gt;Revised:    31-MAR-2010 06:29:45.43 (2)&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;The results report 70 and 60 for the size from Cobol and "7"s and "6"s to pad the data.&lt;BR /&gt;&lt;BR /&gt;Directory shows:&lt;BR /&gt;Record format:      Fixed length 70 byte records&lt;BR /&gt;and&lt;BR /&gt;Record format:      Fixed length 60 byte records&lt;BR /&gt;&lt;BR /&gt;Good luck,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Mar 2010 10:47:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609699#M39705</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-03-31T10:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Defining an indexed FD for two different files.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609700#M39706</link>
      <description>So I suppose that actually I'm doing something wrong, but however your resolution has given me a new idea to solve it, not actually as I wanted to but quite good. I will not explain it 'cause it's off topic but many thanks anyway.</description>
      <pubDate>Thu, 01 Apr 2010 11:43:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/defining-an-indexed-fd-for-two-different-files/m-p/4609700#M39706</guid>
      <dc:creator>Yyrkoon</dc:creator>
      <dc:date>2010-04-01T11:43:49Z</dc:date>
    </item>
  </channel>
</rss>

