<?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: How to find out the difference between two tables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429819#M106196</link>
    <description>&lt;P&gt;is it something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick the &lt;STRONG&gt;C?&lt;/STRONG&gt;&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>Mon, 22 Jan 2018 22:27:15 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-01-22T22:27:15Z</dc:date>
    <item>
      <title>How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429813#M106192</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have table A with 32 variables of 4286 observations and table B with 32&amp;nbsp;variables of 3996 observations.&amp;nbsp;&amp;nbsp; All the variables of the two tables are the same.&amp;nbsp; How to find out the difference of 290 observations between A and B.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429813#M106192</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-01-22T22:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429814#M106193</link>
      <description>&lt;P&gt;Have you tried &lt;STRONG&gt;proc compare&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Also post a small sample and your comparison needs please&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429814#M106193</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-22T22:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429817#M106195</link>
      <description>&lt;P&gt;I did.&amp;nbsp; But it seems the observations are too big.&amp;nbsp;&amp;nbsp; It only listed the 1000.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429817#M106195</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-01-22T22:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429819#M106196</link>
      <description>&lt;P&gt;is it something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick the &lt;STRONG&gt;C?&lt;/STRONG&gt;&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>Mon, 22 Jan 2018 22:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429819#M106196</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-22T22:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429820#M106197</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429820#M106197</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-01-22T22:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429821#M106198</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Really like that example?*/

data campare;
    if _N_ = 1 then do;
    if 0 then set tableB;/*smaller dataset*/
    declare hash h(dataset: 'tableB');/*smaller dataset*/
    h.defineKey('pkey');
    h.defineData(all:'y');
    h.defineDone(); 
  end;
  set tableA; /*the larger dataset*/
  if h.check() ne 0 then output;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429821#M106198</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-22T22:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429834#M106201</link>
      <description>&lt;P&gt;Proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; create table different as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; select * from the biggerdataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; except&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; select * from the smallerdataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;may give you one place to start.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 00:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/429834#M106201</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-23T00:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/430607#M106443</link>
      <description>&lt;P&gt;Awesome, Ballardw!&amp;nbsp; It works!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/430607#M106443</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-01-24T19:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/450699#M113514</link>
      <description>&lt;P&gt;So what if it is something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pkey var1 var2 var3&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pick b and display both?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/450699#M113514</guid>
      <dc:creator>henrykira</dc:creator>
      <dc:date>2018-04-03T15:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out the difference between two tables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/532158#M145788</link>
      <description>&lt;P&gt;As mentioned in the above solution, use except with proc sql, and add union to concatenate the outcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test1;&lt;BR /&gt;input pkey $ var1 var2 var3;&lt;BR /&gt;datalines;&lt;BR /&gt;a 1 2 3&lt;BR /&gt;b 4 5 5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test2;&lt;BR /&gt;input pkey $ var1 var2 var3;&lt;BR /&gt;datalines;&lt;BR /&gt;a 1 2 3&lt;BR /&gt;b 4 5 6&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;(select * from test1&lt;BR /&gt;except&lt;BR /&gt;select * from test2 )&lt;BR /&gt;union&lt;BR /&gt;(select * from test2&lt;BR /&gt;except&lt;BR /&gt;select * from test1)&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-out-the-difference-between-two-tables/m-p/532158#M145788</guid>
      <dc:creator>bijay</dc:creator>
      <dc:date>2019-02-01T19:02:07Z</dc:date>
    </item>
  </channel>
</rss>

