<?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: Why a long numeric value changed after converting the variable from character to numeric? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642152#M191542</link>
    <description>&lt;P&gt;I see. Thank you so much.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 02:44:57 GMT</pubDate>
    <dc:creator>newboy1218</dc:creator>
    <dc:date>2020-04-23T02:44:57Z</dc:date>
    <item>
      <title>Why a long numeric value changed after converting the variable from character to numeric?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642142#M191538</link>
      <description>&lt;P&gt;Hi, I have a dataset where it has a variable that is a character but the value is in a numeric format. Thus, I transformed it from char to num by doing the following logit. However, after the transformation, the numeric value of the ones with a long digit is changed. Why is that? How can I make sure all the values do not change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data output (rename = (ID2 = ID));
	set input;
	format ID2 32.;
	ID2 = ID * 1;
	drop ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ID (char)&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;4475970392100582373&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 15545765241442042890&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;42747761341861168&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ID (num)&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;4475970392100582400&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;15545765241442043904&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;42747761341861168 (this one didn't change)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 01:35:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642142#M191538</guid>
      <dc:creator>newboy1218</dc:creator>
      <dc:date>2020-04-23T01:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why a long numeric value changed after converting the variable from character to numeric?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642147#M191539</link>
      <description>&lt;P&gt;SAS uses 8 bytes of storage to hold numbers so that means it can only hold about 15 digits accurately. The moral of the story is don't convert IDs held as character to numeric as you are likely to lose precision as a consequence. There is no reason to convert numbers stored in character form unless you are performing numerical analysis or mathematical calculations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read more about this here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642147#M191539</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-23T02:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why a long numeric value changed after converting the variable from character to numeric?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642149#M191540</link>
      <description>&lt;P&gt;I see. The reason why I wanted to convert this variable is I want to use this variable later to do merge. I have 2 datasets have the same variables and I want to merge them by this variable. So, if I keep this variable as character, can I still merge these 2 tables?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642149#M191540</guid>
      <dc:creator>newboy1218</dc:creator>
      <dc:date>2020-04-23T02:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why a long numeric value changed after converting the variable from character to numeric?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642151#M191541</link>
      <description>&lt;P&gt;Yes, as long as the two variables are both character you can merge them. In fact merging is more reliable leaving them as character.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642151#M191541</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-23T02:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why a long numeric value changed after converting the variable from character to numeric?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642152#M191542</link>
      <description>&lt;P&gt;I see. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-long-numeric-value-changed-after-converting-the-variable/m-p/642152#M191542</guid>
      <dc:creator>newboy1218</dc:creator>
      <dc:date>2020-04-23T02:44:57Z</dc:date>
    </item>
  </channel>
</rss>

