<?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: Trim the last two characters off of a numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141226#M28411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if value &amp;gt; 90 then value = int(value/100); /* or Floor(value/100) */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Oct 2014 18:57:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-10-24T18:57:56Z</dc:date>
    <item>
      <title>Trim the last two characters off of a numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141224#M28409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;(new DI Studio user)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;(SAS 9.3)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Good Afternoon, All.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I've got a table with a numeric column that has some observations containing too many trailing zeroes. For example, there should be no number over 90 in this column so if there is a 400, it should be a 4, if there is a 1200 it should be 12.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;So, I think I'll need to do a proc sql step to go through the table looking for values over 90. Then, how do I remove the last two characters in that observation? Would I need to convert the format to character first and use a substring function or can I do this while the value is numeric?&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Also, what's a quick way to increment a counter within this where statement that I can output in the log only, so I'll have an idea of how many observations are being updated?&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks!&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 17:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141224#M28409</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-10-24T17:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trim the last two characters off of a numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141225#M28410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Numeric columns...... These are binary we are in the digital age. Those 0's are at the best a result of a conversion from binary to decimal and that decimal is of character type.&lt;/P&gt;&lt;P&gt;Converting character (decimals) to numeric digital binary can be done wit an indicator of the decimal point.&amp;nbsp;&amp;nbsp; It looks you are referring to an external DBMS having a character field containing decimals in hundreds.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141225#M28410</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-24T18:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trim the last two characters off of a numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141226#M28411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if value &amp;gt; 90 then value = int(value/100); /* or Floor(value/100) */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-the-last-two-characters-off-of-a-numeric/m-p/141226#M28411</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-24T18:57:56Z</dc:date>
    </item>
  </channel>
</rss>

