<?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 see what didn't merge? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359534#M274528</link>
    <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;! I'm not sure I understand the proc sql part of your answer, but yes that is essentially what I ended up doing! I did a data step merge to output the records from conc_dados that did not merge with conc_tx_base and then I did a proc sql left join to merge the two datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2017 02:02:16 GMT</pubDate>
    <dc:creator>confused_saser</dc:creator>
    <dc:date>2017-05-18T02:02:16Z</dc:date>
    <item>
      <title>How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359415#M274523</link>
      <description>&lt;P&gt;I just completed a left join using proc sql, however I would like to see what did NOT merge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
	create table conc_merge as
	select* from conc_tx_base as x left join conc_dados as y
	on x.mrn=y.mrn;
run;&lt;/PRE&gt;&lt;P&gt;How can I see what didn't merge from Y (conc_dados)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it can be spit out in another dataset or table that would be awesome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359415#M274523</guid>
      <dc:creator>confused_saser</dc:creator>
      <dc:date>2017-05-17T16:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359417#M274524</link>
      <description>&lt;P&gt;Please clarify "did not merge". Do you mean records in conc_tx_base that did not find any matches in conc_dados?&lt;/P&gt;
&lt;P&gt;Or do you mean records in conc_dados&amp;nbsp;that did not find a match in conc_tx_base?&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359417#M274524</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-17T16:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359430#M274525</link>
      <description>&lt;P&gt;I mean records in conc_dados that did not match up with any MRN in conc_tx_base&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there were 98 records in conc_dados-I want to see how many of these 98 DID NOT match up with an MRN in the conc_tx_base&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359430#M274525</guid>
      <dc:creator>confused_saser</dc:creator>
      <dc:date>2017-05-17T16:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359473#M274526</link>
      <description>&lt;P&gt;That's essentially the opposite of your join &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So try a different join that would meet those conditions&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or do a full join and use a CASE statement to identify the matches/non matches.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359473#M274526</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-17T19:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359499#M274527</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/118497"&gt;@confused_saser&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You can't create multiple output tables with SQL so you would have to implement multiple SQL queries with different join conditions in order to get what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use a SAS Data step merge instead as below (not tested):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select name into :keep_list separated by ' '
  from dictionary.columns
  where libname='WORK' and memname='CONC_DADOS'
  ;
quit;

data 
  conc_merge 
  conc_dados_noMatch (keep=&amp;amp;keep_list)
  ;
  merge conc_tx_base (in=in_base) conc_dados (in=in_dados);
  by mrn;
  if in_base then output conc_merge;
  else if not in_base and in_dados then output conc_dados_noMatch;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 May 2017 21:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359499#M274527</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-05-17T21:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to see what didn't merge?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359534#M274528</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;! I'm not sure I understand the proc sql part of your answer, but yes that is essentially what I ended up doing! I did a data step merge to output the records from conc_dados that did not merge with conc_tx_base and then I did a proc sql left join to merge the two datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 02:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-see-what-didn-t-merge/m-p/359534#M274528</guid>
      <dc:creator>confused_saser</dc:creator>
      <dc:date>2017-05-18T02:02:16Z</dc:date>
    </item>
  </channel>
</rss>

