<?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 Proc Compare- Why two same integer values are different? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456803#M115757</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone, I got a question about proc compare. Why two same integer values &amp;nbsp;are seen different in my compared&amp;nbsp; datasets ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_______________________________________________________________&lt;/P&gt;&lt;P&gt;&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;&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; Base &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compare&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Obs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; || &amp;nbsp; &amp;nbsp;Tab1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tab2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Diff. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; % Diff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;____________ &amp;nbsp;||&amp;nbsp; _________ &amp;nbsp; &amp;nbsp; _________&amp;nbsp; _________ &amp;nbsp; &amp;nbsp; &amp;nbsp; _________&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 710779 &amp;nbsp; &amp;nbsp; &amp;nbsp;|| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4761 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 4761 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; -9.09E-13 &amp;nbsp; &amp;nbsp; -1.91E-14&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 08:40:28 GMT</pubDate>
    <dc:creator>XPrime</dc:creator>
    <dc:date>2018-04-24T08:40:28Z</dc:date>
    <item>
      <title>Proc Compare- Why two same integer values are different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456803#M115757</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone, I got a question about proc compare. Why two same integer values &amp;nbsp;are seen different in my compared&amp;nbsp; datasets ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_______________________________________________________________&lt;/P&gt;&lt;P&gt;&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;&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; Base &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compare&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Obs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; || &amp;nbsp; &amp;nbsp;Tab1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tab2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Diff. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; % Diff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;____________ &amp;nbsp;||&amp;nbsp; _________ &amp;nbsp; &amp;nbsp; _________&amp;nbsp; _________ &amp;nbsp; &amp;nbsp; &amp;nbsp; _________&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 710779 &amp;nbsp; &amp;nbsp; &amp;nbsp;|| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4761 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 4761 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; -9.09E-13 &amp;nbsp; &amp;nbsp; -1.91E-14&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 08:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456803#M115757</guid>
      <dc:creator>XPrime</dc:creator>
      <dc:date>2018-04-24T08:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare- Why two same integer values are different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456806#M115760</link>
      <description>&lt;P&gt;This has been covered many times.&amp;nbsp; SAS stores numbers in 8 bits.&amp;nbsp; I can't remember the exact maths about it, but sometimes a number gets stored which has a very small tiny fraction part due to calculations, so your raw number maybe:&lt;/P&gt;
&lt;P&gt;4761&lt;/P&gt;
&lt;P&gt;vs&lt;/P&gt;
&lt;P&gt;4761.000000000000001&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Utilise the round, int, floor etc. functions on it - in general in any calculation I round or otherwise fix the result to make sure.&amp;nbsp; You can use the fuzz option:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Proc-compare-showing-matching-values-even-after-using-OUTNOEQUAL/m-p/413334#M67459" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Proc-compare-showing-matching-values-even-after-using-OUTNOEQUAL/m-p/413334#M67459&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in general I would recommend fixing the number.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 08:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456806#M115760</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-24T08:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare- Why two same integer values are different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456814#M115767</link>
      <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; says this comes up all the time and there are many reference to the issue of numeric precision in the documentation including this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=hostwin&amp;amp;docsetTarget=n04ccixfia6l2pn1f8szvttqg3hm.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=hostwin&amp;amp;docsetTarget=n04ccixfia6l2pn1f8szvttqg3hm.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because SAS stores numerics in 8 bytes of memory / disk it can only accurately represent any number for the first 15 digits (reading left to right). PROC COMPARE is quite accurately reporting differences beyond the first 15 digits. You can control what PROC COMPARE reports as "numerically equal" by tweaking the CRITERION = and METHOD = options:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n0c1y14wyd3u7yn1dmfcpaejllsn.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n0c1y14wyd3u7yn1dmfcpaejllsn.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 09:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456814#M115767</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-04-24T09:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare- Why two same integer values are different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456955#M115812</link>
      <description>&lt;P&gt;One or both of those values in not an integer. The Proc compare output shows values using a default format that apparently does not want to show 12 decimal places for them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you think that variable should be an integer round or truncate it before use/compare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't think that a difference like 0.000000000909 will not&amp;nbsp;cause problems for further use you could also run your proc compare code with the FUZZ= numericvalue option to ignore very small results.&lt;/P&gt;
&lt;P&gt;Example fuzz= 1E-8 would treat any absolute difference lest than 0.00000001 as "good enough" and not report as a difference in the comparison.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 15:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/456955#M115812</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-26T15:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare- Why two same integer values are different?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/457740#M116091</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;! It really helped me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Why-two-same-integer-values-are-different/m-p/457740#M116091</guid>
      <dc:creator>XPrime</dc:creator>
      <dc:date>2018-04-26T13:36:32Z</dc:date>
    </item>
  </channel>
</rss>

