<?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: Compare 2 numeric variable using &amp;lt;, but not working. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644162#M9110</link>
    <description>Thanks!!! Now it is working correctly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 30 Apr 2020 07:05:37 GMT</pubDate>
    <dc:creator>CHEESE123</dc:creator>
    <dc:date>2020-04-30T07:05:37Z</dc:date>
    <item>
      <title>Compare 2 numeric variable using &lt;, but not working.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644159#M9108</link>
      <description>&lt;P&gt;Anyone can help on below query? please...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Result1 as&lt;BR /&gt;select * , 0.75*Numeric1 as &lt;SPAN&gt;Numeric2&amp;nbsp;&lt;/SPAN&gt;format 12.4&lt;BR /&gt;from DATA1 where ABC=0 and CBD&amp;lt;=25&lt;BR /&gt;and calculated &lt;SPAN&gt;Numeric2&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&amp;nbsp;&lt;SPAN&gt;Numeric3&lt;/SPAN&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Outcome of Result1:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Numeric2&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Numeric3&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1111 (Not sure why this also appear in my output)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 06:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644159#M9108</guid>
      <dc:creator>CHEESE123</dc:creator>
      <dc:date>2020-04-30T06:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 numeric variable using &lt;, but not working.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644161#M9109</link>
      <description>&lt;P&gt;This is an artifact caused by the way the computer stores and calculates numbers (binary in 8 bytes, floating point). Whenever decimal fractions are converted to binary, there is a fair chance that the decimal fraction cannot be represented exactly in binary and causes a minimal error of about E-14 (with a number like 1111 that would be about 1E-11).&lt;/P&gt;
&lt;P&gt;Your display format limits the decimals to 4 digits, so you can't see that difference.&lt;/P&gt;
&lt;P&gt;Use the round() function to get rid of the artifacts:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Result1 as
  select
    *,
    round(0.75*Numeric1,.0001) as Numeric2 format 12.4
  from DATA1
  where ABC=0 and CBD&amp;lt;=25
    and calculated Numeric2 &amp;lt; round(Numeric3,0001)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For more detailed information about the issue, google "sas numeric precision".&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 06:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644161#M9109</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-30T06:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 numeric variable using &lt;, but not working.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644162#M9110</link>
      <description>Thanks!!! Now it is working correctly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Compare-2-numeric-variable-using-lt-but-not-working/m-p/644162#M9110</guid>
      <dc:creator>CHEESE123</dc:creator>
      <dc:date>2020-04-30T07:05:37Z</dc:date>
    </item>
  </channel>
</rss>

