<?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: Working with greater than equal to operator in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668329#M200324</link>
    <description>&lt;P&gt;Add this to your code, and you'll get a clue:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;diff = tag - tag2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Jul 2020 11:33:08 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-07-10T11:33:08Z</dc:date>
    <item>
      <title>Working with greater than equal to operator in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668319#M200319</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;While I ran below code, getting value of variable TAG1 as "unchecked" , eventhough values are getting same for TAG and TAG2. Value for TAG1 is not getting correct according to if condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why is happening so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data readin2;&lt;BR /&gt;a=6882;&lt;BR /&gt;b=9176;&lt;BR /&gt;c=68.82;&lt;BR /&gt;d=91.76;&lt;BR /&gt;format TAG TAG2 12.8;&lt;BR /&gt;TAG=a/b;&lt;BR /&gt;TAG2=c/d;&lt;BR /&gt;length TAG1 $20;&lt;BR /&gt;IF TAG = TAG2 THEN TAG1 = "New";&lt;BR /&gt;ELSE TAG1 ="Unchecked";&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668319#M200319</guid>
      <dc:creator>PW1</dc:creator>
      <dc:date>2020-07-10T10:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Working with greater than equal to operator in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668323#M200321</link>
      <description>&lt;P&gt;Have you seen &lt;A href="https://communities.sas.com/t5/SAS-Programming/int-function-odd-behavior/m-p/667961" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/int-function-odd-behavior/m-p/667961&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668323#M200321</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-10T10:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Working with greater than equal to operator in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668324#M200322</link>
      <description>&lt;P&gt;The problem is that SAS numbers are stored as base 2 floating points, meaning that the decimals cannot be represented exactly. This means that the may be a minuscule difference between the calculation with the integers and the decimal values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data readin2;
a=6882;
b=9176;
c=68.82;
d=91.76;
format TAG TAG2 12.8;
TAG=a/b;
TAG2=c/d;
length TAG1 $20;
IF abs(TAG-TAG2)&amp;lt;1e-10 THEN TAG1 = "New";
ELSE TAG1 ="Unchecked";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 10:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668324#M200322</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-07-10T10:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Working with greater than equal to operator in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668325#M200323</link>
      <description>Eventhough mathematically they are the same how sas is handling the precision might be different. Round both values to a fixed decimal say six positions and then compare. Format statement is display only. It does not change the original value. Use round function instead</description>
      <pubDate>Fri, 10 Jul 2020 10:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668325#M200323</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-10T10:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Working with greater than equal to operator in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668329#M200324</link>
      <description>&lt;P&gt;Add this to your code, and you'll get a clue:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;diff = tag - tag2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 11:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-greater-than-equal-to-operator-in-sas/m-p/668329#M200324</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-10T11:33:08Z</dc:date>
    </item>
  </channel>
</rss>

