<?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: SAS teradata upload error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572333#M161516</link>
    <description>&lt;P&gt;Teradata does not want more than 9 decimal places.&amp;nbsp; You told SAS it could format the number with up to 30 decimal places.&lt;/P&gt;
&lt;P&gt;Try telling SAS to format the number with no more than 9 decimal places.&lt;/P&gt;
&lt;P&gt;Try chaning the format attached to the variable from BEST32. to 32.9 and see if it works.&lt;/P&gt;
&lt;P&gt;You are still not going to be able to get SAS to store more than 15 decimal digits exactly&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 12:06:51 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-10T12:06:51Z</dc:date>
    <item>
      <title>SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572009#M161398</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to upload data to Teradata using:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; v4 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;EXTRACTION_DATE format=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;DATE9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;LIMIT as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; LIMIT_AMT format=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;best32.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;from work.x&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;insert into tera.y&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;select * from v4;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I get the error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ERROR: On an insert, update, or index operation, the value applied to a Teradata 8 byte decimal was out of range - greater than&lt;/P&gt;&lt;P&gt;9.223372036854775808E18.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I solve this?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572009#M161398</guid>
      <dc:creator>ZeroSeven</dc:creator>
      <dc:date>2019-07-09T12:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572190#M161463</link>
      <description>Can you provide some additional information? Some dummy data that shows us what some values would look like on the work.x table, what they look like on the v4 table, the full log from the creation of the v4 table to just after the error message, etc.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 09 Jul 2019 18:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572190#M161463</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-07-09T18:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572193#M161465</link>
      <description>One last question, what are the formats for these two fields on the already existing tera.y table? Can you provide dummy examples for that data as well?</description>
      <pubDate>Tue, 09 Jul 2019 18:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572193#M161465</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-07-09T18:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572222#M161477</link>
      <description>Or more specifically, what is data type and precision in the TD table?</description>
      <pubDate>Tue, 09 Jul 2019 19:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572222#M161477</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-07-09T19:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572227#M161478</link>
      <description>&lt;P&gt;Show the definition of the table you are loading into.&amp;nbsp; From the Teradata documentation an 8 byte decimal value is large enough for decimal numbers with a wide of 10 to 18 digits.&amp;nbsp; The number in your error message has 19 digits.&amp;nbsp; Note also that when you define the variable in Teradata you need to specify how many of those digits are to the right of the decimal point, so the upper bound could be even lower.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also SAS cannot store 19 digits exactly as a number since it uses 8 byte floating point binary numbers.&amp;nbsp; The maximum number of decimal digits is 15.&amp;nbsp; So if I read in&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;9,223,372,036,854,775,808&lt;/PRE&gt;
&lt;P&gt;and print it back out it becomes&lt;/P&gt;
&lt;PRE&gt;9,223,372,036,854,777,856
&lt;/PRE&gt;
&lt;P&gt;Notice how the last four digits have changed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do those number represent?&amp;nbsp; Are they actual numbers that you want to compare? Do you really care about the 16-19 th least significant decimal digits?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you just need to create the field as a floating point number in Teradata instead of a decimal number.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 19:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572227#M161478</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-09T19:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572296#M161504</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More information&lt;/P&gt;&lt;P&gt;The limit_amt variable in Teradata is defined as&lt;/P&gt;&lt;P&gt;&amp;nbsp;LIMIT_AMT DECIMAL(32,9) DEFAULT 0.000000000&amp;nbsp; COMPRESS ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The limit that I'm trying to upload is&lt;/P&gt;&lt;P&gt;10917118759&lt;/P&gt;&lt;P&gt;The format in SAS is&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;NAME&lt;/TD&gt;&lt;TD&gt;TYPE&lt;/TD&gt;&lt;TD&gt;LENGTH&lt;/TD&gt;&lt;TD&gt;VARNUM&lt;/TD&gt;&lt;TD&gt;LABEL&lt;/TD&gt;&lt;TD&gt;FORMAT&lt;/TD&gt;&lt;TD&gt;FORMATL&lt;/TD&gt;&lt;TD&gt;FORMATD&lt;/TD&gt;&lt;TD&gt;INFORMAT&lt;/TD&gt;&lt;TD&gt;INFORML&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;LIMIT_AMT&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;BEST&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;BEST&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly - the dataset on Teradata has been predefined and I don't have access to alter the definitions there&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 05:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572296#M161504</guid>
      <dc:creator>ZeroSeven</dc:creator>
      <dc:date>2019-07-10T05:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572302#M161505</link>
      <description>&lt;P&gt;After further investigation my question now is:&lt;/P&gt;&lt;P&gt;How do I upload a value gt 999,999,999.9 to Teradata where the field is decimal(32,9)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I either get the&lt;/P&gt;&lt;P&gt;ERROR: On an insert, update, or index operation, the value applied to a Teradata 8 byte decimal was out of range - greater than&lt;/P&gt;&lt;P&gt;9.223372036854775808E18.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;ERROR: Teradata insert: Numeric overflow occurred during computation.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 08:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572302#M161505</guid>
      <dc:creator>ZeroSeven</dc:creator>
      <dc:date>2019-07-10T08:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572333#M161516</link>
      <description>&lt;P&gt;Teradata does not want more than 9 decimal places.&amp;nbsp; You told SAS it could format the number with up to 30 decimal places.&lt;/P&gt;
&lt;P&gt;Try telling SAS to format the number with no more than 9 decimal places.&lt;/P&gt;
&lt;P&gt;Try chaning the format attached to the variable from BEST32. to 32.9 and see if it works.&lt;/P&gt;
&lt;P&gt;You are still not going to be able to get SAS to store more than 15 decimal digits exactly&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572333#M161516</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T12:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572339#M161521</link>
      <description>&lt;P&gt;Thanks, Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing formats on the SAS side does not seem to work&lt;/P&gt;&lt;P&gt;It seems that the number is too large, any value less than or equal to 999,999,999.9 gets inserted into the Teradata, any number larger and I get the error&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572339#M161521</guid>
      <dc:creator>ZeroSeven</dc:creator>
      <dc:date>2019-07-10T12:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572340#M161522</link>
      <description>&lt;P&gt;Upload to a volatile table where the variable is defined as float and then copy from there into the real target using a passthru query.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/572340#M161522</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T12:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS teradata upload error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/578525#M164088</link>
      <description>Hi Tom,&lt;BR /&gt;I ran into a similar issue with an error saying "On an insert, update, or index operation, the value applied to a Teradata integer was out of range - greater than 2147483647."&lt;BR /&gt;I ran the query couple times before but I didn't get any error. Double check all of my integer value but none of them exceed 2147483647. Could you please advise what would cause an error? Thanks much.</description>
      <pubDate>Thu, 01 Aug 2019 18:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-teradata-upload-error/m-p/578525#M164088</guid>
      <dc:creator>MelissaN</dc:creator>
      <dc:date>2019-08-01T18:17:14Z</dc:date>
    </item>
  </channel>
</rss>

