<?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: Bug converting characters to numbers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307540#M65889</link>
    <description>&lt;P&gt;Assuming you are on a PC, the maximum precision that can be stored by SAS integers is 16 digits (2**53) since SAS stores numbers in 64 bits (8 bytes), and some of these are not used for the mantissa (the digits of the number). Your numbers are longer than this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you store real numbers, full precison is not always possible, and SAS has further issues (see &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Expected-numeric-precision-behaviour-or-unexpected-issue/td-p/287071" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Expected-numeric-precision-behaviour-or-unexpected-issue/td-p/287071&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 01:55:26 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2016-10-27T01:55:26Z</dc:date>
    <item>
      <title>Bug converting characters to numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307536#M65885</link>
      <description>&lt;P&gt;I'm trying to convert a set of character strings into numbers, and it's not as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any ideas on how to trouble shoot?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;num=input(char,best32.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Obs num char &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;323242600026000064512&lt;/TD&gt;&lt;TD&gt;323242600026000122499&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;313244000040000684032&lt;/TD&gt;&lt;TD&gt;313244000040000698990&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;313242000020000145408&lt;/TD&gt;&lt;TD&gt;313242000020000198990&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;314245000050000134144&lt;/TD&gt;&lt;TD&gt;314245000050000159970&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;323242600026000261120&lt;/TD&gt;&lt;TD&gt;323242600026000222499&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;323242600026000261120&lt;/TD&gt;&lt;TD&gt;323242600026000222499&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;313244000040000290816&lt;/TD&gt;&lt;TD&gt;313244000040000298990&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;323242600026000064512&lt;/TD&gt;&lt;TD&gt;323242600026000122499&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;423242250022500433920&lt;/TD&gt;&lt;TD&gt;423242250022500512797&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;323245000050000134144&lt;/TD&gt;&lt;TD&gt;323245000050000171980&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 01:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307536#M65885</guid>
      <dc:creator>JS</dc:creator>
      <dc:date>2016-10-27T01:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bug converting characters to numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307540#M65889</link>
      <description>&lt;P&gt;Assuming you are on a PC, the maximum precision that can be stored by SAS integers is 16 digits (2**53) since SAS stores numbers in 64 bits (8 bytes), and some of these are not used for the mantissa (the digits of the number). Your numbers are longer than this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you store real numbers, full precison is not always possible, and SAS has further issues (see &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Expected-numeric-precision-behaviour-or-unexpected-issue/td-p/287071" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Expected-numeric-precision-behaviour-or-unexpected-issue/td-p/287071&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 01:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307540#M65889</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-10-27T01:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bug converting characters to numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307550#M65892</link>
      <description>&lt;P&gt;What do these numbers represent? Leave them as character if you are not doing mathematics on them.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 03:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307550#M65892</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-10-27T03:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bug converting characters to numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307731#M65946</link>
      <description>&lt;P&gt;Thanks Chris! This was exceptionally informative and helpful.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 18:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307731#M65946</guid>
      <dc:creator>JS</dc:creator>
      <dc:date>2016-10-27T18:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug converting characters to numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307732#M65947</link>
      <description>&lt;P&gt;Thanks SASKiwi. This was a unique problem that we ran into, and in the future we're going to restructure our coding algorithms to use character strings instead.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 18:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bug-converting-characters-to-numbers/m-p/307732#M65947</guid>
      <dc:creator>JS</dc:creator>
      <dc:date>2016-10-27T18:57:43Z</dc:date>
    </item>
  </channel>
</rss>

