<?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: What is the maximum order numeric variable that SAS is able to process? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179333#M34239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max=constant('exactint');&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put max=comma21.;&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;max=9,007,199,254,740,992&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easiest way to deal with it is to NOT convert your character variable into an numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Feb 2014 16:38:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-02-19T16:38:16Z</dc:date>
    <item>
      <title>What is the maximum order numeric variable that SAS is able to process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179332#M34238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my first post with SAS Support communities, so please bear with me and pardon my misgivings.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I ran into an issue lately where I was trying to convert a character variable into a numeric variable while extracting data from a dataset. The character variable was a 18 digit long numeric value stored as character. So, when I tried importing the variable and converting it into numeric using the input function, only the first 16 digits were getting converted successfully and the last 2 digits were getting arbitrarily random values. So, I took the empirical approach and devised the following simple code to check is SAS is able to process the numericals upto 10^18 numerical precision, and I found that last 2 digits were always lost. Can you please help me understand if my conclusion is correct? Is SAS unable to handle numerical variables beyond 10^16 value? Please adivse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;214&amp;nbsp; data _null_ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;215&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 17 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;216&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; big_num = 10**i + 1 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;217&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put big_num best18. +2 i 2. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;218&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;219&amp;nbsp; run ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1001&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10001&amp;nbsp;&amp;nbsp; 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100001&amp;nbsp;&amp;nbsp; 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000001&amp;nbsp;&amp;nbsp; 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10000001&amp;nbsp;&amp;nbsp; 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100000001&amp;nbsp;&amp;nbsp; 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000000001&amp;nbsp;&amp;nbsp; 9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10000000001&amp;nbsp; 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100000000001&amp;nbsp; 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000000000001&amp;nbsp; 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10000000000001&amp;nbsp; 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; 100000000000001&amp;nbsp; 14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp; 1000000000000001&amp;nbsp; 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;10000000000000000&amp;nbsp; 16&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;100000000000000000&amp;nbsp; 17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For observation 16 and 17 it can be seen that the numerical precision is lost. Please advise how can I go around this issue? Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179332#M34238</guid>
      <dc:creator>vkumbhakarna</dc:creator>
      <dc:date>2014-02-19T16:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the maximum order numeric variable that SAS is able to process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179333#M34239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max=constant('exactint');&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put max=comma21.;&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;max=9,007,199,254,740,992&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easiest way to deal with it is to NOT convert your character variable into an numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179333#M34239</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-02-19T16:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: What is the maximum order numeric variable that SAS is able to process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179334#M34240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe this is a SAS specific issue, as I've seen it in Excel and R recently as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179334#M34240</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-19T16:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: What is the maximum order numeric variable that SAS is able to process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179335#M34241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is indeed no SAS specific issue. It is related to what processor you are using.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695157.htm" title="https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695157.htm"&gt;SAS(R) 9.2 Language Reference: Concepts, Second Edition&lt;/A&gt;&amp;nbsp; (precision) The floating point area are processor instrcutions.&lt;/P&gt;&lt;P&gt;Do not forget &lt;A href="http://support.sas.com/documentation/cdl/en/ds2ref/66664/HTML/default/viewer.htm#titlepage.htm" title="http://support.sas.com/documentation/cdl/en/ds2ref/66664/HTML/default/viewer.htm#titlepage.htm"&gt;SAS(R) 9.4 DS2 Language Reference, Second Edition&lt;/A&gt; as there the approach is differtent and the limitations are different.&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://blogs.sas.com/content/sastraining/2013/04/08/jedi-sas-tricks-finding-tattoine-with-ds2/"&gt;http://blogs.sas.com/content/sastraining/2013/04/08/jedi-sas-tricks-finding-tattoine-with-ds2/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers" title="http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers"&gt;Floating point - Wikipedia, the free encyclopedia&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 19:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-maximum-order-numeric-variable-that-SAS-is-able-to/m-p/179335#M34241</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-02-19T19:22:37Z</dc:date>
    </item>
  </channel>
</rss>

