<?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 Convert character variable of length $36. To Numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837325#M331053</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have Account_ID of length $36. I am trying to convert this to numeric variable but it truncates the last digits or converts the last digit to 0000. Kindly help with the issue.</description>
    <pubDate>Fri, 07 Oct 2022 07:23:35 GMT</pubDate>
    <dc:creator>Satyakshma</dc:creator>
    <dc:date>2022-10-07T07:23:35Z</dc:date>
    <item>
      <title>Convert character variable of length $36. To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837325#M331053</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have Account_ID of length $36. I am trying to convert this to numeric variable but it truncates the last digits or converts the last digit to 0000. Kindly help with the issue.</description>
      <pubDate>Fri, 07 Oct 2022 07:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837325#M331053</guid>
      <dc:creator>Satyakshma</dc:creator>
      <dc:date>2022-10-07T07:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character variable of length $36. To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837330#M331054</link>
      <description>&lt;P&gt;ID variables should not be numeric. Precision of storage is extremely likely to result in modified, i.e. rounded to fit the precision values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you doing arithmetic with Id variables? Why? If you are not doing arithmetic then the variable should stay character.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 07:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837330#M331054</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-07T07:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character variable of length $36. To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837366#M331072</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/359295"&gt;@Satyakshma&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have Account_ID of length $36. I am trying to convert this to numeric variable but it truncates the last digits or converts the last digit to 0000. Kindly help with the issue.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You cannot convert a digit string with 36 characters into a number exactly.&amp;nbsp; The maximum integer that can be represented as a number in SAS before you start losing precision is:&lt;/P&gt;
&lt;PRE&gt;23   data _null_;
24     max = constant('exactint');
25     put max= comma24.;
26   run;

max=9,007,199,254,740,992
&lt;/PRE&gt;
&lt;P&gt;So the maximum length digit string you can be sure will exactly be represented by a number is 15 digits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should not store ID values as numbers anyway.&amp;nbsp; You do not want to take the mean of the ID number.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 12:10:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-variable-of-length-36-To-Numeric/m-p/837366#M331072</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-07T12:10:52Z</dc:date>
    </item>
  </channel>
</rss>

