<?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 How to find maximal decimal digits in value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663722#M198195</link>
    <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need find maximal decimal digits in&lt;FONT color="#FF6600"&gt; value&lt;/FONT&gt; for each &lt;FONT color="#FF6600"&gt;var&lt;/FONT&gt;.&amp;nbsp; Please suggest. Thank you&lt;/P&gt;
&lt;P&gt;In my data below the output needed;&lt;/P&gt;
&lt;P&gt;var&amp;nbsp; &amp;nbsp; maxdecimal&lt;/P&gt;
&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;d&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var $ value;
datalines;
a 100.01
a 110.003
a 100
b 1.1
b 2
c 5.000002
c 6.01
c 4
d 2
d 5
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 20 Jun 2020 16:43:47 GMT</pubDate>
    <dc:creator>knveraraju91</dc:creator>
    <dc:date>2020-06-20T16:43:47Z</dc:date>
    <item>
      <title>How to find maximal decimal digits in value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663722#M198195</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need find maximal decimal digits in&lt;FONT color="#FF6600"&gt; value&lt;/FONT&gt; for each &lt;FONT color="#FF6600"&gt;var&lt;/FONT&gt;.&amp;nbsp; Please suggest. Thank you&lt;/P&gt;
&lt;P&gt;In my data below the output needed;&lt;/P&gt;
&lt;P&gt;var&amp;nbsp; &amp;nbsp; maxdecimal&lt;/P&gt;
&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;d&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var $ value;
datalines;
a 100.01
a 110.003
a 100
b 1.1
b 2
c 5.000002
c 6.01
c 4
d 2
d 5
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Jun 2020 16:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663722#M198195</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2020-06-20T16:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find maximal decimal digits in value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663727#M198198</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input var $ value;
datalines;
a 100.01
a 110.003
a 100
b 1.1
b 2
c 5.000002
c 6.01
c 4
d 2
d 5
;

data want;
 do until(last.var);
  set have;
  by var;
  max_dec=max_dec &amp;lt;&amp;gt; lengthn(scan(cats(value),2,'.'));
 end;
 drop value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Jun 2020 16:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663727#M198198</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-06-20T16:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find maximal decimal digits in value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663730#M198201</link>
      <description>&lt;P&gt;You must trust SAS number to string conversion algorithms (which are pretty good) for this to work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select
    var,
    max(lengthn(scan(put(value, best32.), 2, "."))) as maxDecimal
from have
group by var;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Jun 2020 17:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-maximal-decimal-digits-in-value/m-p/663730#M198201</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-06-20T17:09:12Z</dc:date>
    </item>
  </channel>
</rss>

