<?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 Data Division Question in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128221#M44430</link>
    <description>&lt;BR /&gt;QUOTING HEIN&lt;BR /&gt;"Or... just set the record size in the FDL to 0 and omit 'FORMAT FIXED', then any record size will be allowed."&lt;BR /&gt;&lt;BR /&gt;I like the way you think!  Had a similar problem, searched the forum, found this, and used your fix.  Presto change-o.  It works!&lt;BR /&gt;&lt;BR /&gt;Too bad I can't assign points in this thread.</description>
    <pubDate>Thu, 07 Aug 2008 20:37:51 GMT</pubDate>
    <dc:creator>Homer Shoemaker</dc:creator>
    <dc:date>2008-08-07T20:37:51Z</dc:date>
    <item>
      <title>Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128213#M44422</link>
      <description>Hello,&lt;BR /&gt;     I am new to Cobol on OpenVMS Alpha 7.3.  I just had a simple question.  Does anybody know how manny bytes the following statement represents?  My guess is 8 + 5 = 13.  Or is in Words?  I tried to look this up in the Cobol language reference manual on OpenVMS.org but couldn't find it.&lt;BR /&gt;&lt;BR /&gt;01  WS-VALUE-SUMMARY-TABLE.&lt;BR /&gt;     05  WS-PROD-FORCED-DOWN-TIME      PIC 9(08)V9(05).&lt;BR /&gt;&lt;BR /&gt;     The reason I'm asking this is I had to add some variables to this file definition.  It is a layout for an RMS Indexed file.  I recompiled and relinked the Cobol program and got the following error in the VMS debugger:&lt;BR /&gt;&lt;BR /&gt;1130:                         " DATE: ", SUMMARY-DATE&lt;BR /&gt;-&amp;gt;1131:                 WRITE OPERATION-REC&lt;BR /&gt;  1132:                         INVALID KEY&lt;BR /&gt;  1133:                             DISPLAY "WRITE TO SUMMARY FILE FAILED"&lt;BR /&gt;  1134:                             DISPLAY "FILE STATUS ",FSTAT-OPERATION&lt;BR /&gt;  1135:          END-IF.&lt;BR /&gt;  1136:&lt;BR /&gt;─ OUT -output───────────────────────────────────────────────────────────────────&lt;BR /&gt;stepped to IC4107A\%LINE 1264 in THREAD 1&lt;BR /&gt;stepped to IC4107A\%LINE 1267 in THREAD 1&lt;BR /&gt;stepped to IC4107A\212-GET-SPECIFIC-MACHINE in THREAD 1&lt;BR /&gt;break at IC4107A\%LINE 1131 in THREAD 1&lt;BR /&gt;%COB-F-WRITE_ERROR, Error during WRITE on file OSFTDISK3:[RMS]IC4107A.IDX;2&lt;BR /&gt;-RMS-F-RSZ, invalid record size&lt;BR /&gt;break on unhandled exception preceding SHARE$DEC$COBRTL+107012 in THREAD 1&lt;BR /&gt;─ PROMPT -error-program-prompt──────────────────────────────────────────────────&lt;BR /&gt;%DEBUG-I-SOURCESCOPE, Source lines not available for .0\%PC &lt;BR /&gt;        Displaying source in a caller of the current routine&lt;BR /&gt;DBG&amp;gt;&lt;BR /&gt;&lt;BR /&gt;So basically, I'm trying to fix the error:&lt;BR /&gt;-RMS-F-RSZ, invalid record size&lt;BR /&gt;&lt;BR /&gt;There is a .FDL file for this indexed file.  So I just need to count up the bytes in the Cobol file definition, change the FDL record size and convert/fdl the indexed file, right?  Thanks.</description>
      <pubDate>Fri, 11 Jan 2008 23:55:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128213#M44422</guid>
      <dc:creator>DECxchange</dc:creator>
      <dc:date>2008-01-11T23:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128214#M44423</link>
      <description>Try &lt;A href="http://www.hp.com/go/openvms/doc" target="_blank"&gt;http://www.hp.com/go/openvms/doc&lt;/A&gt; for the manuals, including the COBOL documentation.  (&lt;A href="http://www.OpenVMS.org" target="_blank"&gt;http://www.OpenVMS.org&lt;/A&gt; isn't where you look for HP details and documentations.  That's a user community site.)&lt;BR /&gt;&lt;BR /&gt;The declaration of the file would be interesting, as it looks that your additions to the record were not reflected in the file creation and record size.&lt;BR /&gt;&lt;BR /&gt;As for the size in bytes for packed decimal (and this is from very dim memory), it's usually calculated by calculating the numbers of digits, divided by two, plus one.  Any resulting fraction is rounded up.&lt;BR /&gt;&lt;BR /&gt;S99999999V99999&lt;BR /&gt;&lt;BR /&gt;Which works out to 9 bytes for a packed decimal COMP type, and 13 for non-comp DISPLAY types.&lt;BR /&gt;&lt;BR /&gt;(I'd confirm it, though.)&lt;BR /&gt;&lt;BR /&gt;A straight COMP type is usually easier to calculate.&lt;BR /&gt;&lt;BR /&gt;When presented with this sort of thing, I usually end up using the debugger or other such, and seeing what's actually produced.  Create a little stub or such, and pass it around, and take a look.  Easier than the manuals.&lt;BR /&gt;&lt;BR /&gt;But as for the manuals...&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/DOC/82final/6296/6296pro_018.html" target="_blank"&gt;http://h71000.www7.hp.com/DOC/82final/6296/6296pro_018.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/DOC/82final/6296/6296pro_039.html" target="_blank"&gt;http://h71000.www7.hp.com/DOC/82final/6296/6296pro_039.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Jan 2008 01:55:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128214#M44423</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-01-12T01:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128215#M44424</link>
      <description>Hoff,&lt;BR /&gt;    Thanks for the help and the links.  BTW, the last two links you gave me are exactly what I ended up going to via OpenVMS.org.  There is a link on that latter web site about 1/3 down called "documentation".  It must link you to the HP doc site.  I only looked at the Lang. Ref. though so perhaps I just didn't look close enough or study it hard enough.  But thanks again, appreciate your help.</description>
      <pubDate>Sat, 12 Jan 2008 02:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128215#M44424</guid>
      <dc:creator>DECxchange</dc:creator>
      <dc:date>2008-01-12T02:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128216#M44425</link>
      <description>&lt;BR /&gt;You really need to show a bit more from the record definition to correctly describe the problem. The debugger info is rather useless, just the RMS-F-RSZ is all that's needed.&lt;BR /&gt;&lt;BR /&gt;Anyway, &lt;BR /&gt;&lt;BR /&gt;Yes will likely need to convert the file. And yes you will likely want to match the x in "RECORD; SIZE x; " in the FDL to the cobol length. COBOL/LIS will nicely tell you the new size. Or... some folks 'cheat' and create an edit of the program with OPEN FOR OUTPUT and have cobol create the file, then use ANAL/RMS/FDL on the new file. Delete that new file, and mix and match the old and new fdl as needed.&lt;BR /&gt;Or... just set the record size in the FDL to 0 and omit 'FORMAT FIXED', then any record size will be allowed.&lt;BR /&gt;&lt;BR /&gt;Note... you might need a program instead of a convert to read from all, write to new.&lt;BR /&gt;Convert can 'grow' the record. However, it needs to provide fresh byte values. You can control this with the /PAD switch, but only provide one byte value, typically space, ascii zero, or the default binary-zero.&lt;BR /&gt;If you added both text fields and comp fields, then a simple single byte value typically is not good enough for all fields added and a program is needed.&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Jan 2008 09:03:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128216#M44425</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-01-12T09:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128217#M44426</link>
      <description>Thanks, I did create a listing earlier so I'll take another look and go from there.  Thanks for all of the suggestions.</description>
      <pubDate>Sat, 12 Jan 2008 14:33:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128217#M44426</guid>
      <dc:creator>DECxchange</dc:creator>
      <dc:date>2008-01-12T14:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128218#M44427</link>
      <description>&amp;gt;My guess is 8 + 5 = 13.&lt;BR /&gt;&lt;BR /&gt;I would say yes for usage DISPLAY.  It's true for COBOLII/iX.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Hoff: A straight COMP type is usually easier to calculate.&lt;BR /&gt;&lt;BR /&gt;It's 8 bytes.</description>
      <pubDate>Sun, 13 Jan 2008 01:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128218#M44427</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-01-13T01:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128219#M44428</link>
      <description>An easy way to check this is to include the qualifiers /LIST /MAP=(DECLARED) when you compile. &lt;BR /&gt;The listing will then show you the size of the data structures.&lt;BR /&gt;You should also read up on the /ALIGNMENT qualifier if you have any binary fields.&lt;BR /&gt;Phil</description>
      <pubDate>Sun, 13 Jan 2008 23:20:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128219#M44428</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2008-01-13T23:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128220#M44429</link>
      <description>Phil's suggestion to use /LIST/MAP is the easiest way to see the size(s) of a particular declaration. However, if you want to find a declaration to match a particular size, that's not much help (unless you're into trial and error).&lt;BR /&gt;&lt;BR /&gt;See Tables 5-12 "Unscaled Data Items, Allocated Storage, and Corresponding Data Types" and 5-13 "Scaled Data Items, Allocated Storage, and Data Types" in "HP COBOL Reference Manual" for details of the sizes of data types.&lt;BR /&gt;&lt;BR /&gt;Chapter 16 in "HP COBOL User Manual" will teach you how to ensure your data is layed out in memory the way you want (important if your data must match records in existing files). In particular see "Table 16-1 Boundaries for Naturally Aligned Binary Data (Alpha, I64)" and "Table 16-2 Alignment and Padding Order of Precedence (Alpha, I64)"&lt;BR /&gt;&lt;BR /&gt;Use /LIST/MAP to confirm your declarations are correct.&lt;BR /&gt;</description>
      <pubDate>Sun, 13 Jan 2008 23:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128220#M44429</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-01-13T23:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128221#M44430</link>
      <description>&lt;BR /&gt;QUOTING HEIN&lt;BR /&gt;"Or... just set the record size in the FDL to 0 and omit 'FORMAT FIXED', then any record size will be allowed."&lt;BR /&gt;&lt;BR /&gt;I like the way you think!  Had a similar problem, searched the forum, found this, and used your fix.  Presto change-o.  It works!&lt;BR /&gt;&lt;BR /&gt;Too bad I can't assign points in this thread.</description>
      <pubDate>Thu, 07 Aug 2008 20:37:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128221#M44430</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-08-07T20:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cobol Data Division Question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128222#M44431</link>
      <description>Besides John G's suggestions, also look at the COBOL RM manual for the USAGE clause.  There are tables there for how the compiler computes storage sizes for various declarations.</description>
      <pubDate>Fri, 08 Aug 2008 12:55:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-data-division-question/m-p/4128222#M44431</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2008-08-08T12:55:49Z</dc:date>
    </item>
  </channel>
</rss>

