<?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: OR SQL joins in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/559030#M10222</link>
    <description>&lt;P&gt;Give each match a score and take the observation with the max score for your primary key variables.&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2019 15:48:27 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-05-15T15:48:27Z</dc:date>
    <item>
      <title>OR SQL joins</title>
      <link>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/558978#M10212</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to join 2 datasets through at least one variable, in a hierarchy. For example, join on first name, or join on surname, in that order. However&amp;nbsp;this looks like it works, but not perfectly. It&amp;nbsp;creates duplicates in my first dataset by joining to different records in the second dataset. Is there a way to perform a join and making it stop once a match is found. The below example is not exactly the code. There are actually around 44 joins I need it to run through. I know that it isn't doing both joins separately, because if it were I would get over 2000 additional duplicates (I'm currently getting 52), but ideally I would like no duplicates, once a match is found on the first join, I would like it to stop. I hope I've explained this okay. Thanks in advance for any help you can provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Code Example:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;joined &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="3"&gt;a.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;*, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;b.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Houeshold &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Individual &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a.ID1=b.ID1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;o&lt;/FONT&gt;r a.ID2=b.ID2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Result&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Dataset1ID&amp;nbsp;&amp;nbsp;&amp;nbsp; Dataset2ID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/558978#M10212</guid>
      <dc:creator>JoshGale</dc:creator>
      <dc:date>2019-05-15T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: OR SQL joins</title>
      <link>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/558995#M10216</link>
      <description>&lt;P&gt;Why not just add a step that picks the "best" match?&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/558995#M10216</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-15T15:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: OR SQL joins</title>
      <link>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/559001#M10218</link>
      <description>Hi, we have thought about it, but due to the complex outputs and sheer number of joins it would be challenging to do. It is our backup option, but we are also interested to see if anyone knows why this is happening and if there is a way to do it within the join.</description>
      <pubDate>Wed, 15 May 2019 15:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/559001#M10218</guid>
      <dc:creator>JoshGale</dc:creator>
      <dc:date>2019-05-15T15:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: OR SQL joins</title>
      <link>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/559030#M10222</link>
      <description>&lt;P&gt;Give each match a score and take the observation with the max score for your primary key variables.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/OR-SQL-joins/m-p/559030#M10222</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-15T15:48:27Z</dc:date>
    </item>
  </channel>
</rss>

