<?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: Select data with only 4 decimals in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688920#M209378</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 k=2.4678;
 output;
 k=2.34;
 output;
 k=2;
 output;
 k=2.4450;
 output;
 k=2.4400;
run;

data want;
 set have;
 if mod(k*1e4,10);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;/*or where*/&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; where mod(k*1e4,10);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 05 Oct 2020 16:17:30 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-10-05T16:17:30Z</dc:date>
    <item>
      <title>Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688913#M209373</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I have a dataset that is interest rate, most of the data is in a 2 decimal format (eg. 2.45), but some rows have a 4 decimals (eg. 2.4678) format.&amp;nbsp; How do I chose the data that has only the 4 decimals?&amp;nbsp; Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 15:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688913#M209373</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2020-10-05T15:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688920#M209378</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 k=2.4678;
 output;
 k=2.34;
 output;
 k=2;
 output;
 k=2.4450;
 output;
 k=2.4400;
run;

data want;
 set have;
 if mod(k*1e4,10);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;/*or where*/&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; where mod(k*1e4,10);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Oct 2020 16:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688920#M209378</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-05T16:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688922#M209379</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1797"&gt;@podarum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp; I have a dataset that is interest rate, most of the data is in a 2 decimal format (eg. 2.45), but some rows have a 4 decimals (eg. 2.4678) format.&amp;nbsp; How do I chose the data that has only the 4 decimals?&amp;nbsp; Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the field is not a character string then you don't.&lt;/P&gt;
&lt;P&gt;How can you tell the difference between a value that was original written as '2.50' and a value written as '2.500'?&amp;nbsp; They are the same number.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 16:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688922#M209379</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-05T16:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688925#M209380</link>
      <description>&lt;P&gt;The solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;fails if k=2.46789.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	ychar=put(k,best12.);
	if length(strip(scan(ychar,2,'.')))=4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;And&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;makes a good point too...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 16:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688925#M209380</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-05T16:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688937#M209383</link>
      <description>&lt;P&gt;Yes, that's correct. The solution assumes based upon OP wrote "&lt;SPAN&gt;&lt;EM&gt;most of the data is in a 2 decimal format (eg. 2.45), but some rows have a 4 decimals (eg. 2.4678) format&lt;/EM&gt;."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 16:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688937#M209383</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-05T16:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688939#M209385</link>
      <description>What's your original data source? Can you read it in as character first?&lt;BR /&gt;This would solve your problem, technically....you may still have logic issues.</description>
      <pubDate>Mon, 05 Oct 2020 16:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688939#M209385</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-05T16:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688951#M209392</link>
      <description>Thanks everyone, the answers are great</description>
      <pubDate>Mon, 05 Oct 2020 17:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/688951#M209392</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2020-10-05T17:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select data with only 4 decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/689057#M209445</link>
      <description>&lt;P&gt;Another way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;if length( scan( put(VAR,best32. -l), 2, '. ' ) ) = 4;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 01:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-data-with-only-4-decimals/m-p/689057#M209445</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-06T01:25:58Z</dc:date>
    </item>
  </channel>
</rss>

