<?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: SAS Join vs Union in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910358#M20902</link>
    <description>&lt;P&gt;Your example is a match-merge, which is a limited version of a full outer join, not a union. The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1i8w2bwu1fn5kn1gpxj18xttbb0.htm" target="_blank" rel="noopener"&gt;MERGE statement&lt;/A&gt; can only join one-to-many distinct values of the BY variable. If there are repeats in BY values in both the first and second datasets, only the repeats from the first dataset are kept.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 01:40:50 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2024-01-04T01:40:50Z</dc:date>
    <item>
      <title>SAS Join vs Union</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910357#M20901</link>
      <description>&lt;P&gt;Hi, I have this piece of code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data data3;&lt;BR /&gt;merge data1(in=a) data2(in=b);&lt;BR /&gt;by id&lt;BR /&gt;if a or b;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I read this code, I am the impression that this will be like a full outer join. However, when I run this program, it becomes more of a union than a full outer join. Please keep in mind that data1 has 2 columns, including the ID and date while data2 has 3 - ID, date and description.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to understand as to why data3 resulted into a union rather than a full outer join. Is there a specific instance where it will be a full outer join than a union?&lt;/P&gt;&lt;P&gt;Any insight will be helpful. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 01:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910357#M20901</guid>
      <dc:creator>Vinz867</dc:creator>
      <dc:date>2024-01-04T01:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Join vs Union</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910358#M20902</link>
      <description>&lt;P&gt;Your example is a match-merge, which is a limited version of a full outer join, not a union. The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1i8w2bwu1fn5kn1gpxj18xttbb0.htm" target="_blank" rel="noopener"&gt;MERGE statement&lt;/A&gt; can only join one-to-many distinct values of the BY variable. If there are repeats in BY values in both the first and second datasets, only the repeats from the first dataset are kept.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 01:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910358#M20902</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-04T01:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Join vs Union</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910359#M20903</link>
      <description>&lt;P&gt;Thank you! I think I understand this now!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 01:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Join-vs-Union/m-p/910359#M20903</guid>
      <dc:creator>Vinz867</dc:creator>
      <dc:date>2024-01-04T01:40:03Z</dc:date>
    </item>
  </channel>
</rss>

