 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sending -/+ Number from VB.NET to COBOL</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 20:47:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/#comment-86482</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 12 Jan 2011 23:45:20 +0000</pubDate>
		<guid isPermaLink="false">#comment-86482</guid>
		<description><![CDATA[There could be some minor differences between OPM and ILE handling of parameters if there were others, particularly when single-byte (e.g., a boolean indicator value) parameters are involved. It was a &quot;just in case&quot; question that might be relevant in later programs but wasn&#039;t relevant here.

Glad the precision/scale detail helped. Cross-vendor (IBM + MS) documentation isn&#039;t particularly clear in that area.

Note that &quot;stored proc&quot; is more of a thought to how things might be implemented behind-the-scenes rather than how you set things up. I&#039;d be interested in knowing which AS/400 job the COBOL program shows up in. The particular server job sometimes helps in figuring out how bytes get formatted going across the network.

Tom]]></description>
		<content:encoded><![CDATA[<p>There could be some minor differences between OPM and ILE handling of parameters if there were others, particularly when single-byte (e.g., a boolean indicator value) parameters are involved. It was a &#8220;just in case&#8221; question that might be relevant in later programs but wasn&#8217;t relevant here.</p>
<p>Glad the precision/scale detail helped. Cross-vendor (IBM + MS) documentation isn&#8217;t particularly clear in that area.</p>
<p>Note that &#8220;stored proc&#8221; is more of a thought to how things might be implemented behind-the-scenes rather than how you set things up. I&#8217;d be interested in knowing which AS/400 job the COBOL program shows up in. The particular server job sometimes helps in figuring out how bytes get formatted going across the network.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beanbaggs</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/#comment-86459</link>
		<dc:creator>beanbaggs</dc:creator>
		<pubDate>Wed, 12 Jan 2011 15:41:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-86459</guid>
		<description><![CDATA[It is OPM COBOL, but I compiled it in ILE and get the same results so problem isn&#039;t specific to one or the other.

That is the complete list of Parameters,  this is just me trying to get it to work so I made it very simple (or at least I thought). 

I am NOT running through any stored procedure, I am calling the program directly.  I could set one up if that is the problem, but wouldn&#039;t think I would have to?

&lt;b&gt;I added the precision and scale to the VB.NET code and seems to be working now.   Thanks Tom for all your help.  Will edit this if come across other issues but seems to be working now.&lt;/b&gt;]]></description>
		<content:encoded><![CDATA[<p>It is OPM COBOL, but I compiled it in ILE and get the same results so problem isn&#8217;t specific to one or the other.</p>
<p>That is the complete list of Parameters,  this is just me trying to get it to work so I made it very simple (or at least I thought). </p>
<p>I am NOT running through any stored procedure, I am calling the program directly.  I could set one up if that is the problem, but wouldn&#8217;t think I would have to?</p>
<p><b>I added the precision and scale to the VB.NET code and seems to be working now.   Thanks Tom for all your help.  Will edit this if come across other issues but seems to be working now.</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/#comment-86418</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 12 Jan 2011 00:41:55 +0000</pubDate>
		<guid isPermaLink="false">#comment-86418</guid>
		<description><![CDATA[Just to be certain, is that the &lt;b&gt;complete&lt;/b&gt; list of parameters? Also, is it ILE COBOL or COBOL/400?

&lt;i&gt;cmdparm1.Size = 7
cmdparm1.Value = -23456&lt;/i&gt;

Consider using:

&lt;i&gt;cmdparm1.Precision = 7
cmdparm1.Scale = 0
cmdparm1.Value = -23456.0&lt;/i&gt;

A DECIMAL value should need &lt;i&gt;precision&lt;/i&gt; and &lt;i&gt;scale&lt;/i&gt; rather than just a &lt;i&gt;size&lt;/i&gt;.

Also, many clients like to make their own decisions about how they represent numeric values. When decimal points and digits are supplied, they often behave a little differently. When values are presented without decimal points/digits, many clients assume that an INTEGER data type is okay. Sometimes that leads down a data format conversion code path that isn&#039;t always debugged by developers of the client code.

Without more detail, I&#039;d guess that this is still implemented as a call to a stored proc. You can call your COBOL through stored proc mechanisms even if there has been no stored proc defined to the database as long as you only need ParameterDirection.Input -- your iSeries DB2 will handle that okay. It&#039;s only when DB2 is expected to format parameter values to send back that it needs to know definitions. But that&#039;s all only secondary; other code might demonstrate that stored proc concepts aren&#039;t relevant.

Tom]]></description>
		<content:encoded><![CDATA[<p>Just to be certain, is that the <b>complete</b> list of parameters? Also, is it ILE COBOL or COBOL/400?</p>
<p><i>cmdparm1.Size = 7<br />
cmdparm1.Value = -23456</i></p>
<p>Consider using:</p>
<p><i>cmdparm1.Precision = 7<br />
cmdparm1.Scale = 0<br />
cmdparm1.Value = -23456.0</i></p>
<p>A DECIMAL value should need <i>precision</i> and <i>scale</i> rather than just a <i>size</i>.</p>
<p>Also, many clients like to make their own decisions about how they represent numeric values. When decimal points and digits are supplied, they often behave a little differently. When values are presented without decimal points/digits, many clients assume that an INTEGER data type is okay. Sometimes that leads down a data format conversion code path that isn&#8217;t always debugged by developers of the client code.</p>
<p>Without more detail, I&#8217;d guess that this is still implemented as a call to a stored proc. You can call your COBOL through stored proc mechanisms even if there has been no stored proc defined to the database as long as you only need ParameterDirection.Input &#8212; your iSeries DB2 will handle that okay. It&#8217;s only when DB2 is expected to format parameter values to send back that it needs to know definitions. But that&#8217;s all only secondary; other code might demonstrate that stored proc concepts aren&#8217;t relevant.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beanbaggs</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/#comment-86405</link>
		<dc:creator>beanbaggs</dc:creator>
		<pubDate>Tue, 11 Jan 2011 18:40:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-86405</guid>
		<description><![CDATA[Here is the connection string in VB.NET............
Dim dbconn As New OleDb.OleDbConnection(&quot;Provider=IBMDA400; OLE DB    Services=-2; Data Source=S106****; User Id=*****; Password=*******&quot;)

Here is setting of the parameter in Visual Basic 2005.........
cmdparm1.ParameterName = &quot;POLNUM&quot;
cmdparm1.OleDbType = OleDb.OleDbType.Decimal
cmdparm1.Direction = ParameterDirection.Input
cmdparm1.Size = 7
cmdparm1.Value = -23456

Here is the COBOL program Linkage section......
LINKAGE SECTION.
01  WS-AMOUNT                    PIC S9(7) COMP-3.

We are calling the program directly not using a Stored Procedure.  From a COBOL side it seems as if the issue is VB.NET can&#039;t add leading zeros and that causes they negative symbol to not be on the last character.  I get this message for the field in the DUMP.............

**INVALID DATA  &#039;23456D00&#039;X 

Now if I do this and send all 7 digits then it works....................
Here is setting of the parameter in Visual Basic 2005.........
cmdparm1.ParameterName = &quot;POLNUM&quot;
cmdparm1.OleDbType = OleDb.OleDbType.Decimal
cmdparm1.Direction = ParameterDirection.Input
cmdparm1.Size = 7
cmdparm1.Value = -1223456

Cobol value I see................1,223,456-]]></description>
		<content:encoded><![CDATA[<p>Here is the connection string in VB.NET&#8230;&#8230;&#8230;&#8230;<br />
Dim dbconn As New OleDb.OleDbConnection(&#8220;Provider=IBMDA400; OLE DB    Services=-2; Data Source=S106****; User Id=*****; Password=*******&#8221;)</p>
<p>Here is setting of the parameter in Visual Basic 2005&#8230;&#8230;&#8230;<br />
cmdparm1.ParameterName = &#8220;POLNUM&#8221;<br />
cmdparm1.OleDbType = OleDb.OleDbType.Decimal<br />
cmdparm1.Direction = ParameterDirection.Input<br />
cmdparm1.Size = 7<br />
cmdparm1.Value = -23456</p>
<p>Here is the COBOL program Linkage section&#8230;&#8230;<br />
LINKAGE SECTION.<br />
01  WS-AMOUNT                    PIC S9(7) COMP-3.</p>
<p>We are calling the program directly not using a Stored Procedure.  From a COBOL side it seems as if the issue is VB.NET can&#8217;t add leading zeros and that causes they negative symbol to not be on the last character.  I get this message for the field in the DUMP&#8230;&#8230;&#8230;&#8230;.</p>
<p>**INVALID DATA  &#8217;23456D00&#8242;X </p>
<p>Now if I do this and send all 7 digits then it works&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
Here is setting of the parameter in Visual Basic 2005&#8230;&#8230;&#8230;<br />
cmdparm1.ParameterName = &#8220;POLNUM&#8221;<br />
cmdparm1.OleDbType = OleDb.OleDbType.Decimal<br />
cmdparm1.Direction = ParameterDirection.Input<br />
cmdparm1.Size = 7<br />
cmdparm1.Value = -1223456</p>
<p>Cobol value I see&#8230;&#8230;&#8230;&#8230;&#8230;.1,223,456-</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sending-plus-number-from-vbnet-to-cobol/#comment-86339</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Mon, 10 Jan 2011 23:52:07 +0000</pubDate>
		<guid isPermaLink="false">#comment-86339</guid>
		<description><![CDATA[Please define what you mean by:

&lt;i&gt;...to send ... to a COBOL program?&lt;/i&gt;

Especially how does it relate to:

&lt;i&gt;...OLE DB would convert it for them?&lt;/i&gt;

Are you trying to invoke a stored procedure? I would normally assume that that is true. If you are, then we need to see both the stored proc definition along with the COBOL LINKAGE SECTION definitions. (And if you&#039;re not trying for a stored proc, we need to know what protocol you want to use.)

Tom]]></description>
		<content:encoded><![CDATA[<p>Please define what you mean by:</p>
<p><i>&#8230;to send &#8230; to a COBOL program?</i></p>
<p>Especially how does it relate to:</p>
<p><i>&#8230;OLE DB would convert it for them?</i></p>
<p>Are you trying to invoke a stored procedure? I would normally assume that that is true. If you are, then we need to see both the stored proc definition along with the COBOL LINKAGE SECTION definitions. (And if you&#8217;re not trying for a stored proc, we need to know what protocol you want to use.)</p>
<p>Tom</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.014 seconds using memcached
Object Caching 324/327 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 21:09:49 -->