<?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: proc compare in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509613#M1811</link>
    <description>&lt;P&gt;Nice &amp;amp; I am glad. To spice up&amp;nbsp;a little bit for knowledge share,&amp;nbsp;&amp;nbsp;Hash can even mimic set operators by loading&amp;nbsp; full record loading entire record i.e all columns are keys.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ah, well and the consequences?, effect on RAM,? will it even fit in memory?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This leads us&amp;nbsp; to jump into creating composite keys using partial keys with MD5 or &lt;STRIKE&gt;SHA256&amp;nbsp;&lt;/STRIKE&gt; algorithm to make the keys fit into memory.&lt;/P&gt;
&lt;P&gt;The reason for mentioning and scoring off&amp;nbsp;&lt;STRIKE&gt;SHA256&amp;nbsp;&lt;/STRIKE&gt;&lt;SPAN&gt;&amp;nbsp;, is because it is several times slower than MD5 because of its very nature as explained by guru PD&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B-tree index is slightly easy to implement as opposed AVL trees is what I am guessing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The the next question is why? Why can't the implementation be perfected. Let's see what happens in next release.&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Nov 2018 17:13:02 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-11-01T17:13:02Z</dc:date>
    <item>
      <title>proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509590#M1801</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with proc compare and would like to output records that are in the base dataset and not found in the compare dataset and the same if records are found in the compare dataset and not in the base dataset.&lt;/P&gt;&lt;P&gt;In my example have1 dataset is the master dataset never to be updated, if something in have2 is different then an issue accrued during data entry,&amp;nbsp; The datasets from the proc compare output H1_H2_diff_id and H2_H1_diff_id give me what I would expect for records needing attention in have2 that differ from have1. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I make proc compare output records found in one dataset and not the other dataset. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input id $ date mmddyy10.;
cards;
12 11/1/2009
1456 1/1/2008
1 12/12/2012
2158974 4/4/2018
2158984 5/4/2018
2458974 9/4/2018
2158972 4/1/2018
2587911 10/1/2018
2587915 10/8/2018
;
proc sort data=have1;
	by id;
run;

data have2;
input id $ date mmddyy10.;
cards;
1456 1/1/2008
1 12/12/2012
2158974 4/4/2018
2158984 5/4/2018
2587915 10/7/2018
2458974 9/4/2018
2158972 4/1/2018
987588121 10/31/2018
;
proc sort data=have2;
	by id;
run;
/*  With the by ID I get what I want when records have different values.
	but I would like to output records found in base that are not 
    found in compare to dataset inbase_not_compare
	and if records are in compare that are not
    in base to another dataset incompare_not_base.
	Can this be done in the proc compare process?
*/ 
proc compare base=have1 compare=have2 out=h1_h2_diff_id outall outnoequal;
by id;
run;
proc compare base=have2 compare=have1 out=h2_h1_diff_id outall outnoequal;
by id;
run;
proc compare base=have1 compare=have2 out=h1_h2_diff outall outnoequal;

run;
proc compare base=have2 compare=have1 out=h2_h1_diff outall outnoequal;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you for you assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509590#M1801</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-01T16:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509596#M1802</link>
      <description>&lt;P&gt;While Proc Compare can be handy for some things I think you may be looking form something more like this which creates two datasets with the unique records or different values. Note that this does not work with data sets with different variables and would require explicitly sub-setting each data set to the common variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table in1not2 as
   select * from have1
   except
   select * from have2;
   create table in2not1 as
   select * from have2
   except
   select * from have1;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509596#M1802</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-01T16:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509602#M1806</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; This works for my request.&amp;nbsp; I see that ID 2587915 shows in both datasets because of the miss-match on date.&amp;nbsp; This would give me the missing records and the miss-matched records.&amp;nbsp; Seems better than proc compare in my case.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509602#M1806</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-01T16:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509607#M1808</link>
      <description>&lt;P&gt;The distinction in comparison is whether based on ID or based on the entire record.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's on id, subsetting using merge, join or subsquery, hash etc should be the way to go&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if it's the complete record, set operators in sql is very handy like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;demonstrated&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509607#M1808</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-01T16:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509611#M1809</link>
      <description>&lt;P&gt;thanks for all the assistance.&amp;nbsp; My sample was only on ID. but the real world case is the full record compare of 881 variables so&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; example code works the best for my case at this time.&amp;nbsp; I was trying to make the horse drink water by using proc compare in this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 17:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509611#M1809</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-01T17:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509613#M1811</link>
      <description>&lt;P&gt;Nice &amp;amp; I am glad. To spice up&amp;nbsp;a little bit for knowledge share,&amp;nbsp;&amp;nbsp;Hash can even mimic set operators by loading&amp;nbsp; full record loading entire record i.e all columns are keys.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ah, well and the consequences?, effect on RAM,? will it even fit in memory?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This leads us&amp;nbsp; to jump into creating composite keys using partial keys with MD5 or &lt;STRIKE&gt;SHA256&amp;nbsp;&lt;/STRIKE&gt; algorithm to make the keys fit into memory.&lt;/P&gt;
&lt;P&gt;The reason for mentioning and scoring off&amp;nbsp;&lt;STRIKE&gt;SHA256&amp;nbsp;&lt;/STRIKE&gt;&lt;SPAN&gt;&amp;nbsp;, is because it is several times slower than MD5 because of its very nature as explained by guru PD&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B-tree index is slightly easy to implement as opposed AVL trees is what I am guessing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The the next question is why? Why can't the implementation be perfected. Let's see what happens in next release.&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 17:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-compare/m-p/509613#M1811</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-01T17:13:02Z</dc:date>
    </item>
  </channel>
</rss>

