<?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: Merging 3 datasets to find no matches in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-to-find-no-matches/m-p/313542#M68147</link>
    <description>&lt;P&gt;So you want to keep all records in A that don't find matches in either B or C?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   merge a(in=inA) b(in=inB) c(in=inC);
   by id date;
   if inA and not inB and not inC;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Nov 2016 17:53:26 GMT</pubDate>
    <dc:creator>bnawrocki</dc:creator>
    <dc:date>2016-11-22T17:53:26Z</dc:date>
    <item>
      <title>Merging 3 datasets to find no matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-to-find-no-matches/m-p/313536#M68144</link>
      <description>&lt;P&gt;I would like to merge three datasets A, B, and C to find all the&amp;nbsp;obs in A that do not match B and C. B and C are both subsets of A. Obs in B and C do not match each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried the code below and many other logic test, but I cannot seem to get the right output. Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; want;&lt;/P&gt;
&lt;P&gt;merge A(in= inA) B(in=inB) C(in=inC);&lt;/P&gt;
&lt;P&gt;by&amp;nbsp;id date;&lt;/P&gt;
&lt;P&gt;if not inA or (not inB&amp;nbsp;and not inC) then&lt;/P&gt;
&lt;P&gt;output want;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 17:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-to-find-no-matches/m-p/313536#M68144</guid>
      <dc:creator>wil1212</dc:creator>
      <dc:date>2016-11-22T17:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Merging 3 datasets to find no matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-to-find-no-matches/m-p/313542#M68147</link>
      <description>&lt;P&gt;So you want to keep all records in A that don't find matches in either B or C?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   merge a(in=inA) b(in=inB) c(in=inC);
   by id date;
   if inA and not inB and not inC;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 17:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-3-datasets-to-find-no-matches/m-p/313542#M68147</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2016-11-22T17:53:26Z</dc:date>
    </item>
  </channel>
</rss>

