<?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: Reading a numeric variable with length 38,0 from an IBM Db2 database in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443304#M282805</link>
    <description>&lt;P&gt;Using DBSASTYPE like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;suggests set as an option on your table metadata objects is certainly worth a try (using CHAR(38)).&amp;nbsp;If you also write to the table then set also the DBTYPE option.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Mar 2018 14:02:32 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-03-07T14:02:32Z</dc:date>
    <item>
      <title>Reading a numeric variable with length 38,0 from an IBM Db2 database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/442900#M282802</link>
      <description>&lt;P&gt;When trying to read (or open) a table from an IBM Db2 database (via DI Studio), we get the following errors:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: CLI open cursor error: [IBM][CLI Driver] SQL30020N Execution of the command or SQL statement failed because of a syntax error in the communication data stream that will affect the successful execution of subsequent commands and SQL statements: Reason Code "0x220A"("0100")"". SQLSTATE=58009&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: CLI close cursor error: [IBM][CLI Driver] CLI0108E Communication link failure. SQLSTATE=40003&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;This is because of 1 specific numeric variable. If we stop reading it, then everything else loads correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The numeric variable is likely troublesome because it's&amp;nbsp;stored with the length 38,0 in the source database.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any advice on how we might remedy this? I'm hoping there's some kind of library setting&amp;nbsp;or precode we might use to force the variable into an acceptable numeric format.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/442900#M282802</guid>
      <dc:creator>ErikNM</dc:creator>
      <dc:date>2018-03-06T14:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a numeric variable with length 38,0 from an IBM Db2 database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443038#M282803</link>
      <description>&lt;P&gt;Does DI give you any option to tell SAS to convert it to a string?&amp;nbsp; Using the DBSASTYPE dataset option?&lt;/P&gt;
&lt;P&gt;There is no way to store 38 digits accurately in a numeric variable.&lt;/P&gt;
&lt;P&gt;Most likely the value is being used as an identifier and not an actual number with 38 significant digits so you would want to convert it to a string anyway.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 20:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443038#M282803</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-06T20:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a numeric variable with length 38,0 from an IBM Db2 database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443133#M282804</link>
      <description>&lt;P&gt;DB2 can store no more than 19 digits accurately afaik, just like SAS (on PC/Unix) can store no more than 16 accurate digits (mainframes can store a few more as they use a longer mantissa).&lt;/P&gt;
&lt;P&gt;So any 32-digit number in DB2 will&amp;nbsp;almost certainly be different from the number stored. This can be seen in SAS too.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  A=12345678901234567890123456789012;
  put A= 32.0; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;A=12345678901234566802609541218304&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^ the digits&amp;nbsp;after this point are inaccurate&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A precision of 38 is silly, and creates issues, even within the IBM world. See link below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;You best bet is to create a view or a nickname. See &lt;A href="http://www.channeldb2.com/profiles/blogs/create-nickname-to-db2i-table" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 01:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443133#M282804</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-07T01:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a numeric variable with length 38,0 from an IBM Db2 database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443304#M282805</link>
      <description>&lt;P&gt;Using DBSASTYPE like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;suggests set as an option on your table metadata objects is certainly worth a try (using CHAR(38)).&amp;nbsp;If you also write to the table then set also the DBTYPE option.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 14:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-numeric-variable-with-length-38-0-from-an-IBM-Db2/m-p/443304#M282805</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-03-07T14:02:32Z</dc:date>
    </item>
  </channel>
</rss>

