<?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 Join on first and last name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216543#M39903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two datasets (one from Excel, one from SAS) that each have first and last name variables. I am trying to join the two datasets on first name and last name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from have1 a&lt;/P&gt;&lt;P&gt;inner join have2 b&lt;/P&gt;&lt;P&gt;on (a.have1_first_name=b.have2_first_name) and (a.have1_last_name=b.have1_last_name);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The join worked on about 2/3 of the dataset, but not the other 1/3. The problem is that I can't figure out why the join isn't working on the remaining 1/3. I've looked some non-joiners up by hand and there are no initials or capitalization issues or anything like that--the values look identical to me, but still aren't recognized as identical by SAS. I need some ideas on how to troubleshoot and figure out the disparity between the values so I can complete the join. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2015 14:57:50 GMT</pubDate>
    <dc:creator>Walternate</dc:creator>
    <dc:date>2015-08-04T14:57:50Z</dc:date>
    <item>
      <title>Join on first and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216543#M39903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two datasets (one from Excel, one from SAS) that each have first and last name variables. I am trying to join the two datasets on first name and last name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from have1 a&lt;/P&gt;&lt;P&gt;inner join have2 b&lt;/P&gt;&lt;P&gt;on (a.have1_first_name=b.have2_first_name) and (a.have1_last_name=b.have1_last_name);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The join worked on about 2/3 of the dataset, but not the other 1/3. The problem is that I can't figure out why the join isn't working on the remaining 1/3. I've looked some non-joiners up by hand and there are no initials or capitalization issues or anything like that--the values look identical to me, but still aren't recognized as identical by SAS. I need some ideas on how to troubleshoot and figure out the disparity between the values so I can complete the join. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216543#M39903</guid>
      <dc:creator>Walternate</dc:creator>
      <dc:date>2015-08-04T14:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join on first and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216544#M39904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trim and set cases and recheck would be my suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;create table want as&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;select * from have1 a&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;inner join have2 b&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;on (upper(trim(a.have1_first_name))=upper(trim(b.have2_first_name))) and (upper(trim(a.have1_last_name))=upper(trim(b.have1_last_name)));&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216544#M39904</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-04T15:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join on first and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216545#M39905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would agree, though&lt;/P&gt;&lt;P&gt;on upper(cats(a.have1_first_name,a.have1_last_name))=upper(cats(b.have1_first_name,b.have1_last_name))&lt;/P&gt;&lt;P&gt;Should also work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-on-first-and-last-name/m-p/216545#M39905</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-04T15:12:02Z</dc:date>
    </item>
  </channel>
</rss>

