<?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 How to show matched and unmatched obs in proc sql in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-show-matched-and-unmatched-obs-in-proc-sql/m-p/112783#M31215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I use proc sql procedure to merge two dataset A and B. I wonder in the default merging process, all the observations in the merged dataset will be only matched observations or they include unmatched ones? Also, how to identify whether the unmatched ones are from A or B. I want to a new variable to show this information (like variable merge with values 1-A, 2-B, or 3-both A &amp;amp; B).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Oct 2013 04:10:43 GMT</pubDate>
    <dc:creator>SeanZ</dc:creator>
    <dc:date>2013-10-15T04:10:43Z</dc:date>
    <item>
      <title>How to show matched and unmatched obs in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-show-matched-and-unmatched-obs-in-proc-sql/m-p/112783#M31215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I use proc sql procedure to merge two dataset A and B. I wonder in the default merging process, all the observations in the merged dataset will be only matched observations or they include unmatched ones? Also, how to identify whether the unmatched ones are from A or B. I want to a new variable to show this information (like variable merge with values 1-A, 2-B, or 3-both A &amp;amp; B).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 04:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-show-matched-and-unmatched-obs-in-proc-sql/m-p/112783#M31215</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-10-15T04:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to show matched and unmatched obs in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-show-matched-and-unmatched-obs-in-proc-sql/m-p/112784#M31216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The type of join condition descides how the "merge" is done. Using full join selects all rows from each tabe. &lt;/P&gt;&lt;P&gt;This example might work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt; length a a1 $10;&lt;BR /&gt; input a a1;&lt;BR /&gt; datalines;&lt;BR /&gt; two hands&lt;BR /&gt; tree hands&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data b;&lt;BR /&gt; length b b1 $10;&lt;BR /&gt; input b b1;&lt;BR /&gt; datalines;&lt;BR /&gt; one leg&lt;BR /&gt; two legs&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt; create table c as &lt;BR /&gt; select coalesce(a.a, b.b) as c &lt;BR /&gt;&amp;nbsp; ,a.a1 &lt;BR /&gt;&amp;nbsp; ,b.b1&lt;BR /&gt;&amp;nbsp; ,ifc(missing(a.a),'N','J') as ina&lt;BR /&gt;&amp;nbsp; ,ifc(missing(b.b),'N','J') as inb&lt;BR /&gt; from a &lt;BR /&gt;&amp;nbsp;&amp;nbsp; full join b&lt;BR /&gt;&amp;nbsp;&amp;nbsp; on a.a = b.b&lt;BR /&gt; ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 06:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-show-matched-and-unmatched-obs-in-proc-sql/m-p/112784#M31216</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2013-10-15T06:19:02Z</dc:date>
    </item>
  </channel>
</rss>

