<?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: Logic failing to pass certification even though values are the same in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323338#M62083</link>
    <description>&lt;P&gt;I would say there is a problem with your numeric data (maybe not rounded?). &amp;nbsp;This is a good examplpe of where posting test data to show what you have would be a good idea. &amp;nbsp;As from what you have posted:&lt;/P&gt;
&lt;PRE&gt;data test;
  balance=897.61;
  f_balance=897.02;
  balance_difference=0.59;
  balance_check=ifn(balance=f_balance or balance=round(f_balance+balance_difference,0.02),1,.);
run;&lt;/PRE&gt;
&lt;P&gt;Works fine for me. &amp;nbsp;Note I simplified your if/else logic somewhat. &amp;nbsp;Maybe try rounding balance (in fact round each of the values involved):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2017 12:39:56 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-01-09T12:39:56Z</dc:date>
    <item>
      <title>Logic failing to pass certification even though values are the same</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323332#M62081</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have&amp;nbsp; the below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Balance = F_Balance&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;then Balance_check = 1; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if Balance = round(F_Balance + Balance_Difference,0.02)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;then Balance_check = 1; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Balance_check = not_OK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently checking over 500 fields, all pass apart from 1 row which shows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Balance&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; =&amp;nbsp; 897.61&lt;/P&gt;&lt;P&gt;F_balance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; 897.02&lt;/P&gt;&lt;P&gt;Balance_Difference =&amp;nbsp; 0.59&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now this should pass however it keeps failing check as it should populate Balance_check with a value of 1 however its blank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"1"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; repesents pass&lt;/P&gt;&lt;P&gt;"blank" repesents fail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have even tried removing the rounding 0.02 and still fails this one row, my dataset looks correct but i dont know where i am going wrong, also all fields are numeric formatting&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 12:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323332#M62081</guid>
      <dc:creator>RJ2016</dc:creator>
      <dc:date>2017-01-09T12:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Logic failing to pass certification even though values are the same</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323335#M62082</link>
      <description>&lt;P&gt;Why would you round to the nearest 2 cents, and expect there to be a match? &amp;nbsp;You could try changing 0.02 to 0.01 and round to the nearest penny.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondarily, do you really have a variable named "NOT_OK"? &amp;nbsp;(If not, just what are you trying to insert into the numeric variable BALANCE_CHECK?)&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 12:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323335#M62082</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-09T12:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logic failing to pass certification even though values are the same</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323338#M62083</link>
      <description>&lt;P&gt;I would say there is a problem with your numeric data (maybe not rounded?). &amp;nbsp;This is a good examplpe of where posting test data to show what you have would be a good idea. &amp;nbsp;As from what you have posted:&lt;/P&gt;
&lt;PRE&gt;data test;
  balance=897.61;
  f_balance=897.02;
  balance_difference=0.59;
  balance_check=ifn(balance=f_balance or balance=round(f_balance+balance_difference,0.02),1,.);
run;&lt;/PRE&gt;
&lt;P&gt;Works fine for me. &amp;nbsp;Note I simplified your if/else logic somewhat. &amp;nbsp;Maybe try rounding balance (in fact round each of the values involved):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 12:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Logic-failing-to-pass-certification-even-though-values-are-the/m-p/323338#M62083</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-09T12:39:56Z</dc:date>
    </item>
  </channel>
</rss>

