<?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 Please help! How do I get the numbers after the decimal of a number variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921816#M363002</link>
    <description>For the the numeric variable num=10.9 I want the 9 in a variable. If the number is 10.78 I want 78 in a variable.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
    <pubDate>Tue, 26 Mar 2024 16:18:55 GMT</pubDate>
    <dc:creator>kyle234</dc:creator>
    <dc:date>2024-03-26T16:18:55Z</dc:date>
    <item>
      <title>Please help! How do I get the numbers after the decimal of a number variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921816#M363002</link>
      <description>For the the numeric variable num=10.9 I want the 9 in a variable. If the number is 10.78 I want 78 in a variable.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Tue, 26 Mar 2024 16:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921816#M363002</guid>
      <dc:creator>kyle234</dc:creator>
      <dc:date>2024-03-26T16:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Please help! How do I get the numbers after the decimal of a number variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921818#M363003</link>
      <description>&lt;P&gt;Can you explain what you are doing?&amp;nbsp; Why do you need the digits after the period as a separate variable?&amp;nbsp; How many digits do you need?&amp;nbsp; What do want for a number like 1/3 that cannot be represented exactly in as a decimal fraction?&amp;nbsp; Do you want 3? 33? 333? 3333?&amp;nbsp;&amp;nbsp;If you want 2 digits why do you want 10.9 to be 9 instead of 90?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want the remainder use the MOD() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;remainder = mod(NUM,1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will get you .9 and .78 for your two examples.&amp;nbsp; You could multiply by 100 to get 90 and 78 instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want the string then convert the number into (back into?) a string and use string functions.&amp;nbsp; So assuming you want two digits after the decimal place you might do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;string=scan(put(NUM,32.2),2,'.');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But that will get you '90' and '78' for your examples.&amp;nbsp; To get '9' and '78' use BEST32. instead as the format in the PUT() function call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 16:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921818#M363003</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-26T16:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Please help! How do I get the numbers after the decimal of a number variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921819#M363004</link>
      <description>Thank you!</description>
      <pubDate>Tue, 26 Mar 2024 16:42:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-How-do-I-get-the-numbers-after-the-decimal-of-a/m-p/921819#M363004</guid>
      <dc:creator>kyle234</dc:creator>
      <dc:date>2024-03-26T16:42:15Z</dc:date>
    </item>
  </channel>
</rss>

