<?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 Values not EXACTLY Equal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926890#M364786</link>
    <description>&lt;P&gt;How do I get more detail about the lines in BOLD? When I use option LISTOBS it will list the observations that it finds different. However when I view them I don't see any differences. How do I find out which vars are different when there are 95 vars?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Method=RELATIVE(0.0000222), Criterion=1.0E-09)&lt;BR /&gt;Data Set Summary&lt;BR /&gt;Dataset Created Modified NVar NObs&lt;BR /&gt;ORDATA.ORACLETEMP 03MAY24:07:20:37 03MAY24:07:20:37 95 26553&lt;BR /&gt;SNOWDATA.SNOWTEMP 03MAY24:07:21:21 03MAY24:07:21:21 95 26553&lt;BR /&gt;Variables Summary&lt;BR /&gt;Number of Variables in Common: 95.&lt;BR /&gt;Number of ID Variables: 10.&lt;/P&gt;&lt;P&gt;Number of Observations in Common: 24450.&lt;BR /&gt;&lt;STRONG&gt;Number of Observations in ORDATA.ORACLETEMP but not in SNOWDATA.SNOWTEMP: 2103. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Number of Observations in SNOWDATA.SNOWTEMP but not in ORDATA.ORACLETEMP: 2103.&lt;/STRONG&gt;&lt;BR /&gt;Total Number of Observations Read from ORDATA.ORACLETEMP: 26553.&lt;BR /&gt;Total Number of Observations Read from SNOWDATA.SNOWTEMP: 26553.&lt;BR /&gt;&lt;BR /&gt;Number of Observations with Some Compared Variables Unequal: 0.&lt;BR /&gt;Number of Observations with All Compared Variables Equal: 24450.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values Comparison Summary&lt;BR /&gt;Number of Variables Compared with All Observations Equal: 85.&lt;BR /&gt;Number of Variables Compared with Some Observations Unequal: 0.&lt;BR /&gt;Total Number of Values which Compare Unequal: 0.&lt;BR /&gt;&lt;STRONG&gt;Total Number of Values not EXACTLY Equal: 3628. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Maximum Difference Criterion Value: 2.2094E-16.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;title "ordata.&amp;amp;ordsn versus &amp;amp;snowdsn";&lt;BR /&gt;proc compare base=ordata.&amp;amp;ordsn&lt;BR /&gt;compare=snowdata.&amp;amp;snowdsn&lt;BR /&gt;Criterion=0.000000001 fuzz=.001&lt;BR /&gt;out=result listobs outbase outcomp outdif outnoequal maxprint=50;&lt;BR /&gt;id member medicaid_no claim_number line_number PAY_DT F_DOS L_DOS DOS AMT_REQ QTY&lt;BR /&gt;;&lt;BR /&gt;attrib _all_ label='';&lt;BR /&gt;format _all_;&lt;BR /&gt;informat _all_;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 12:43:38 GMT</pubDate>
    <dc:creator>ljschroeder</dc:creator>
    <dc:date>2024-05-03T12:43:38Z</dc:date>
    <item>
      <title>Proc Compare Values not EXACTLY Equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926890#M364786</link>
      <description>&lt;P&gt;How do I get more detail about the lines in BOLD? When I use option LISTOBS it will list the observations that it finds different. However when I view them I don't see any differences. How do I find out which vars are different when there are 95 vars?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Method=RELATIVE(0.0000222), Criterion=1.0E-09)&lt;BR /&gt;Data Set Summary&lt;BR /&gt;Dataset Created Modified NVar NObs&lt;BR /&gt;ORDATA.ORACLETEMP 03MAY24:07:20:37 03MAY24:07:20:37 95 26553&lt;BR /&gt;SNOWDATA.SNOWTEMP 03MAY24:07:21:21 03MAY24:07:21:21 95 26553&lt;BR /&gt;Variables Summary&lt;BR /&gt;Number of Variables in Common: 95.&lt;BR /&gt;Number of ID Variables: 10.&lt;/P&gt;&lt;P&gt;Number of Observations in Common: 24450.&lt;BR /&gt;&lt;STRONG&gt;Number of Observations in ORDATA.ORACLETEMP but not in SNOWDATA.SNOWTEMP: 2103. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Number of Observations in SNOWDATA.SNOWTEMP but not in ORDATA.ORACLETEMP: 2103.&lt;/STRONG&gt;&lt;BR /&gt;Total Number of Observations Read from ORDATA.ORACLETEMP: 26553.&lt;BR /&gt;Total Number of Observations Read from SNOWDATA.SNOWTEMP: 26553.&lt;BR /&gt;&lt;BR /&gt;Number of Observations with Some Compared Variables Unequal: 0.&lt;BR /&gt;Number of Observations with All Compared Variables Equal: 24450.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values Comparison Summary&lt;BR /&gt;Number of Variables Compared with All Observations Equal: 85.&lt;BR /&gt;Number of Variables Compared with Some Observations Unequal: 0.&lt;BR /&gt;Total Number of Values which Compare Unequal: 0.&lt;BR /&gt;&lt;STRONG&gt;Total Number of Values not EXACTLY Equal: 3628. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Maximum Difference Criterion Value: 2.2094E-16.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;title "ordata.&amp;amp;ordsn versus &amp;amp;snowdsn";&lt;BR /&gt;proc compare base=ordata.&amp;amp;ordsn&lt;BR /&gt;compare=snowdata.&amp;amp;snowdsn&lt;BR /&gt;Criterion=0.000000001 fuzz=.001&lt;BR /&gt;out=result listobs outbase outcomp outdif outnoequal maxprint=50;&lt;BR /&gt;id member medicaid_no claim_number line_number PAY_DT F_DOS L_DOS DOS AMT_REQ QTY&lt;BR /&gt;;&lt;BR /&gt;attrib _all_ label='';&lt;BR /&gt;format _all_;&lt;BR /&gt;informat _all_;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 12:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926890#M364786</guid>
      <dc:creator>ljschroeder</dc:creator>
      <dc:date>2024-05-03T12:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare Values not EXACTLY Equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926896#M364791</link>
      <description>&lt;P&gt;It means that you have different values in at least one of your ID variables (consider that statement to be like a BY).&lt;/P&gt;
&lt;P&gt;If there are numeric values that&amp;nbsp;&lt;EM&gt;look&lt;/EM&gt; identical, you may have small differences far down in the fractional part, caused by the usual numeric imprecision.&lt;/P&gt;
&lt;P&gt;CRITERION does not influence the working of ID.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 13:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926896#M364791</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-05-03T13:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare Values not EXACTLY Equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926899#M364792</link>
      <description>&lt;P&gt;For the ID statement, you only want to include the variables that are necessary to make a unique ID, i.e. one that will not have any duplicates.&amp;nbsp; &amp;nbsp;From your variable names, I would guess:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id member medicaid_no claim_number line_number ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&amp;nbsp; maybe you don't need line_number if your data only has one record for each claim_number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of your values are being evaluated as equal:&lt;/P&gt;
&lt;PRE&gt;Number of Variables Compared with All Observations Equal: 85.
Number of Variables Compared with Some Observations Unequal: 0.
Total Number of Values which Compare Unequal: 0.
Total Number of Values not EXACTLY Equal: 3628.
Maximum Difference Criterion Value: 2.2094E-16.&lt;/PRE&gt;
&lt;P&gt;The biggest difference it finds is .00000000000000022094, which is just numerical precision noise.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 14:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926899#M364792</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-03T14:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Compare Values not EXACTLY Equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926908#M364798</link>
      <description>&lt;P&gt;Based on your results and what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote there are no differences for the rows with matching ID's but there are&amp;nbsp;2103 rows that don't match over the ID variables highly likely caused by some very small differences in at least one of these ID variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could first round numerical variables to some non-significant decimal place before the comparison using code as below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.&amp;amp;ordsn;
  set ordata.&amp;amp;ordsn;
  array _numvars _numeric_;
  do over _numvars;
    _numvars=round(_numvars,0.00000000001);
  end;
run;
data work.&amp;amp;snowdsn;
  set snowdata.&amp;amp;snowdsn;
  array _numvars _numeric_;
  do over _numvars;
    _numvars=round(_numvars,0.00000000001);
  end;
run;

title "ordata.&amp;amp;ordsn versus &amp;amp;snowdsn";
proc compare base=work.&amp;amp;ordsn
  compare=work.&amp;amp;snowdsn
  Criterion=0.000000001 fuzz=.001
  out=result listobs outbase outcomp outdif outnoequal maxprint=50;
  id member medicaid_no claim_number line_number PAY_DT F_DOS L_DOS DOS AMT_REQ QTY
  ;
  attrib _all_ label='';
  format _all_;
  informat _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 May 2024 15:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Compare-Values-not-EXACTLY-Equal/m-p/926908#M364798</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-03T15:02:46Z</dc:date>
    </item>
  </channel>
</rss>

