<?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: Selecting only records from Dataset A where the same records do not exist in Dataset B in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261954#M51053</link>
    <description>&lt;P&gt;As Linus suggests EXCEPT is the solution here e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tablea;
	infile datalines dlm=",";
	input imb_code rule_number;
datalines;
1,9
2,8
3,7
4,6
5,5
;
run;

data tableb;
	infile datalines dlm=",";
	input imb_code rule_number;
datalines;
1,9
4,6
;
run;

proc sql;
	create table tablec as
	select * from tablea
except
	select * from tableb
	;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Apr 2016 23:32:27 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2016-04-06T23:32:27Z</dc:date>
    <item>
      <title>Selecting only records from Dataset A where the same records do not exist in Dataset B</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261934#M51045</link>
      <description>&lt;P&gt;I have Dataset A and Dataset B both with the variables Imb_code and Rule_Number. I need to keep only records in Dataset A that do not exist in Dataset B. &amp;nbsp;In Oracle SQL I would use a Minus operator, something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select imb_code, rule_number&lt;/P&gt;&lt;P&gt;from TableA&lt;/P&gt;&lt;P&gt;Minus&lt;/P&gt;&lt;P&gt;select imb_code, rule_number&lt;/P&gt;&lt;P&gt;from TableA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would this best be done in SAS?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 20:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261934#M51045</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-04-06T20:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting only records from Dataset A where the same records do not exist in Dataset B</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261937#M51046</link>
      <description>&lt;P&gt;Try the ANSI SQL Set operator EXCEPT.&lt;/P&gt;
&lt;P&gt;Another option would be to left join and filter out matches (test on IMB_CODE IS NULL).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 20:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261937#M51046</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-06T20:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting only records from Dataset A where the same records do not exist in Dataset B</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261952#M51052</link>
      <description>&lt;P&gt;Really struggling here with syntax. &amp;nbsp;Any chance someone can throw our an example of these two suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 23:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261952#M51052</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-04-06T23:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting only records from Dataset A where the same records do not exist in Dataset B</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261954#M51053</link>
      <description>&lt;P&gt;As Linus suggests EXCEPT is the solution here e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tablea;
	infile datalines dlm=",";
	input imb_code rule_number;
datalines;
1,9
2,8
3,7
4,6
5,5
;
run;

data tableb;
	infile datalines dlm=",";
	input imb_code rule_number;
datalines;
1,9
4,6
;
run;

proc sql;
	create table tablec as
	select * from tablea
except
	select * from tableb
	;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 23:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-only-records-from-Dataset-A-where-the-same-records-do/m-p/261954#M51053</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2016-04-06T23:32:27Z</dc:date>
    </item>
  </channel>
</rss>

