<?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: Evaluating COBOL expression gives unexpected result in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218838#M44157</link>
    <description>Thanks Richard.  I considered the  IS NOT NUMERIC solution after I had already moved on to the next section of code, but I'll probably go back.  That's probably a better solution than checking for spaces.</description>
    <pubDate>Mon, 23 Jun 2008 15:17:54 GMT</pubDate>
    <dc:creator>Homer Shoemaker</dc:creator>
    <dc:date>2008-06-23T15:17:54Z</dc:date>
    <item>
      <title>Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218826#M44145</link>
      <description>&lt;!--!*#--&gt;I'm probably missing something basic here.  Please help if you can.&lt;BR /&gt;&lt;BR /&gt;AlphaServer 800 5/333&lt;BR /&gt;OpenVMS V7.1-1H2&lt;BR /&gt;DEC COBOL V2.4&lt;BR /&gt;OpenVMS Alpha DEBUG Version V7.1-000&lt;BR /&gt;&lt;BR /&gt;I'm not getting branching in my program the way I'm expecting to.  I compare a variable whose value is zero (according to debug examine and evaluate)to see if it's less than one.  Then if it is less than one, I move the value one to one of the variables.&lt;BR /&gt;&lt;BR /&gt;Anyway, if you look at the debug list attached, the system is evaluating  0 &amp;lt; 1 as FALSE.&lt;BR /&gt;&lt;BR /&gt;Both variables are PIC 9(3).&lt;BR /&gt;&lt;BR /&gt;Although one is a redefine of a PIC X(3).</description>
      <pubDate>Wed, 18 Jun 2008 19:10:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218826#M44145</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-18T19:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218827#M44146</link>
      <description>Trying again to post the attachment.</description>
      <pubDate>Wed, 18 Jun 2008 19:13:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218827#M44146</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-18T19:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218828#M44147</link>
      <description>Please try your COBOL test code over on EISNER:: (DECUServe), or on the HP test drive systems.&lt;BR /&gt;&lt;BR /&gt;EISNER:: has COBOL 2.8 and OpenVMS Alpha V8.3.&lt;BR /&gt;&lt;BR /&gt;Or post up a concise source code example reproducer of what you're doing here.</description>
      <pubDate>Wed, 18 Jun 2008 19:30:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218828#M44147</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-06-18T19:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218829#M44148</link>
      <description>I think I found a clue using the debug evaluate /bin (/hex /dec).&lt;BR /&gt;&lt;BR /&gt;DBG&amp;gt; ev ORDER-BATCH-PS-PRINT-RUN&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;DBG&amp;gt; ev /hex ORDER-BATCH-PS-PRINT-RUN&lt;BR /&gt;202020&lt;BR /&gt;&lt;BR /&gt;DBG&amp;gt; ev /bin ORDER-BATCH-PS-PRINT-RUN&lt;BR /&gt;00100000 0010000000100000&lt;BR /&gt;&lt;BR /&gt;DBG&amp;gt; ev /dec ORDER-BATCH-PS-PRINT-RUN&lt;BR /&gt;2105376&lt;BR /&gt;&lt;BR /&gt;I'll post again when I'm sure.</description>
      <pubDate>Wed, 18 Jun 2008 19:35:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218829#M44148</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-18T19:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218830#M44149</link>
      <description>0x0202020 is ASCII spaces, which can point to a buffer overrun or to a variable that contains string data.</description>
      <pubDate>Wed, 18 Jun 2008 19:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218830#M44149</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-06-18T19:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218831#M44150</link>
      <description>The ASCII spaces is what I'm checking into.  &lt;BR /&gt;&lt;BR /&gt;I'm getting the data from the rededined field and it previously had no data (undefined or spaces).  Some records will have had the new numeric data written to the field and some not.&lt;BR /&gt;&lt;BR /&gt;Looks like I can't test that field to determine whether it's been updated or not.&lt;BR /&gt;&lt;BR /&gt;Let me make sure.&lt;BR /&gt;&lt;BR /&gt;Thanks Hoff.</description>
      <pubDate>Wed, 18 Jun 2008 19:59:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218831#M44150</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-18T19:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218832#M44151</link>
      <description>Okay, that was it.&lt;BR /&gt;&lt;BR /&gt;I thought that if I referred to the redefined (numeric) name in the expression, that the compiler would know to change the spaces to a zero.  Or at least complain.&lt;BR /&gt;&lt;BR /&gt;NOPE.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Jun 2008 20:13:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218832#M44151</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-18T20:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218833#M44152</link>
      <description>Think of REDEFINES as a C UNION or Pascal variant-record.  Multiple names for the same piece of memory.  The compiler really has no way of knowing what you've last shoved into the memory.  There is no invisible conversion behind your back.</description>
      <pubDate>Fri, 20 Jun 2008 11:21:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218833#M44152</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2008-06-20T11:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218834#M44153</link>
      <description>Thanks John, and now that I think of it, I'm pretty sure we actually take advantage of that behavior on occasion.&lt;BR /&gt;&lt;BR /&gt;Sometimes you just get stuck, and it helps just to define what you're seeing well enough to ask for help.&lt;BR /&gt;&lt;BR /&gt;Turns out that in this case, if the redefined field hasn't been updated with numeric data then it always contains spaces.  &lt;BR /&gt;&lt;BR /&gt;So my comparison needed to be:&lt;BR /&gt;&lt;BR /&gt;if redefined-variable = spaces&lt;BR /&gt;&lt;BR /&gt;instead of &lt;BR /&gt;&lt;BR /&gt;if redefined-variable &amp;lt; 1</description>
      <pubDate>Fri, 20 Jun 2008 12:50:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218834#M44153</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-20T12:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218835#M44154</link>
      <description>&amp;gt;John: Think of REDEFINES as a C UNION or Pascal variant-record.&lt;BR /&gt;&lt;BR /&gt;Level 66 RENAMES also is like that.</description>
      <pubDate>Fri, 20 Jun 2008 14:51:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218835#M44154</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-06-20T14:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218836#M44155</link>
      <description>Thanks Dennis.  Interesting.  I didn't know that.  I've never had occasion to use a level 66 item.  I'll look into it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Jun 2008 17:03:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218836#M44155</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-20T17:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218837#M44156</link>
      <description>Hi Homer,&lt;BR /&gt;&lt;BR /&gt;Don't forget IS NUMERIC and INSPECT REPLACEING ALL. &lt;BR /&gt;&lt;BR /&gt;To expect the compiler to produce more than a compile-time error when performing some sort of Java casting or generics check would, IMHO, be a worthless exercise.&lt;BR /&gt;&lt;BR /&gt;You're just mapping a chunck of memory, and COBOL, like most other 3GLS, let's you describe it however you like. Works for me.&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher</description>
      <pubDate>Sat, 21 Jun 2008 09:36:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218837#M44156</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2008-06-21T09:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating COBOL expression gives unexpected result</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218838#M44157</link>
      <description>Thanks Richard.  I considered the  IS NOT NUMERIC solution after I had already moved on to the next section of code, but I'll probably go back.  That's probably a better solution than checking for spaces.</description>
      <pubDate>Mon, 23 Jun 2008 15:17:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/evaluating-cobol-expression-gives-unexpected-result/m-p/4218838#M44157</guid>
      <dc:creator>Homer Shoemaker</dc:creator>
      <dc:date>2008-06-23T15:17:54Z</dc:date>
    </item>
  </channel>
</rss>

