<?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 String to numeric lopping off last 2 digits in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164689#M31839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings all.&amp;nbsp; I've got some string data that are numbers left padded with zeros.&amp;nbsp; In the source DB2 table they are decimal(10,0), but I am getting them from an Oracle database that includes text in the same column, and all the numeric data are zero padded to 10 characters long.&amp;nbsp; I though I could simply use input, but that is lopping off the right 2 characters.&amp;nbsp; This is what I am trying...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = '0123456789' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num = input(string,8.) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put num ;&lt;/P&gt;&lt;P&gt;run ; quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect the value of num to be 123456789, but it is ending up being 1234567.&amp;nbsp; I'm not sure why this is not working.&amp;nbsp; Any ideas?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Feb 2014 21:04:22 GMT</pubDate>
    <dc:creator>gsnidow</dc:creator>
    <dc:date>2014-02-05T21:04:22Z</dc:date>
    <item>
      <title>String to numeric lopping off last 2 digits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164689#M31839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings all.&amp;nbsp; I've got some string data that are numbers left padded with zeros.&amp;nbsp; In the source DB2 table they are decimal(10,0), but I am getting them from an Oracle database that includes text in the same column, and all the numeric data are zero padded to 10 characters long.&amp;nbsp; I though I could simply use input, but that is lopping off the right 2 characters.&amp;nbsp; This is what I am trying...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = '0123456789' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num = input(string,8.) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put num ;&lt;/P&gt;&lt;P&gt;run ; quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect the value of num to be 123456789, but it is ending up being 1234567.&amp;nbsp; I'm not sure why this is not working.&amp;nbsp; Any ideas?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 21:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164689#M31839</guid>
      <dc:creator>gsnidow</dc:creator>
      <dc:date>2014-02-05T21:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: String to numeric lopping off last 2 digits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164690#M31840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DOH!&amp;nbsp; I was thinking that 8. would allow for the greatest number possible, but 10. works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 21:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164690#M31840</guid>
      <dc:creator>gsnidow</dc:creator>
      <dc:date>2014-02-05T21:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: String to numeric lopping off last 2 digits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164691#M31841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't forget to count the decimal point when reading decimal values as well.&lt;/P&gt;&lt;P&gt;Reading 1234.567&amp;nbsp; with 7.3 will also disappoint. (Hint: 1234.56 is 7 characters).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 21:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164691#M31841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-05T21:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: String to numeric lopping off last 2 digits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164692#M31842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if I'm getting this right, for a 10 digit number, I need to use a numeric variable with length 6., but in the input statement I need to use 10 to specify the number of characters?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 21:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164692#M31842</guid>
      <dc:creator>gsnidow</dc:creator>
      <dc:date>2014-02-05T21:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: String to numeric lopping off last 2 digits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164693#M31843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would not bother to make ANY numeric variable length LT 8.&amp;nbsp; The W for an INFORMAT should be GE the longest string of digit characters, signs, decimals, commas and dollar signs being read.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 21:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/String-to-numeric-lopping-off-last-2-digits/m-p/164693#M31843</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-02-05T21:48:20Z</dc:date>
    </item>
  </channel>
</rss>

