<?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: same person with different name in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607550#M17556</link>
    <description>&lt;P&gt;What is the logic here? If a name is contained in another name within the same FirmID, then consider as the same Name?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 06:22:21 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-11-27T06:22:21Z</dc:date>
    <item>
      <title>same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607548#M17555</link>
      <description>&lt;P&gt;Hi SAS experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirmID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Name&lt;/P&gt;&lt;P&gt;10001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Smith, Bob Alpha&lt;/P&gt;&lt;P&gt;10001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Smith, Bob A.&lt;/P&gt;&lt;P&gt;10002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bloomberg, Jack Beta&lt;/P&gt;&lt;P&gt;10002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bloomberg, Jack B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first two names are actually for the same person and the last two names are also for the same person. The logic is if one name (like Bloomgerg, Jack B.) is contained in the full name (like Bloomberg, Jack Beta) in the same company, then delete the short name and keep the completed name. Is there any way that I can get the dataset like below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirmID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Name&lt;/P&gt;&lt;P&gt;10001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Smith, Bob Alpha&lt;/P&gt;&lt;P&gt;10002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bloomberg, Jack Beta&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607548#M17555</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2019-11-27T16:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607550#M17556</link>
      <description>&lt;P&gt;What is the logic here? If a name is contained in another name within the same FirmID, then consider as the same Name?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 06:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607550#M17556</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-27T06:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607551#M17557</link>
      <description>&lt;P&gt;If you can define the rules when to keep which observation, i am sure that code can be written to do so. From the data you have posted, i don't see a rule explaining why for FirmID 10001 the first name is taken, and for the other FirmID the second name.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 06:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607551#M17557</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-11-27T06:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607637#M17572</link>
      <description>&lt;P&gt;There are too many things you need to consider about.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here could get you a start .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input FirmID                 Name $40.;
cards;
10001           Smith, Bob Alpha
10001           Smith, Bob A.
10002           Bloomberg, Jack Beta
10002           Bloomberg, Jack B.
;
proc sql;
select distinct a.*
 from have as a,have as b
  where a.FirmID=b.FirmID and a.Name ne b.Name and
   a.Name contains strip(substr(b.Name,1,length(b.name)-1));
quit;
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 11:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607637#M17572</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-27T11:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607763#M17590</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I have revised my question.&amp;nbsp;The logic is if one name (like Bloomgerg, Jack B.) is contained in the full name (like Bloomberg, Jack Beta) in the same company, then delete the short name and keep the completed name.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607763#M17590</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2019-11-27T16:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607765#M17591</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. You are correct. I also revised my question further.&amp;nbsp;The logic is if one name (like Bloomgerg, Jack B.) is contained in the full name (like Bloomberg, Jack Beta) in the same company, then delete the short name and keep the completed name.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607765#M17591</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2019-11-27T16:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607851#M17596</link>
      <description>&lt;P&gt;Can we presume that last names will always match exactly for any given person? So we only need to do "contains" tests for the rest of each name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And are all the realizations of a "contain" situations in which the shorter name exactly matches the first part to the remaining name?&amp;nbsp; Or can you have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Smith, B. James&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Smith, Brian James&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 21:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607851#M17596</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-11-27T21:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607920#M17604</link>
      <description>&lt;P&gt;If all the shortened names have a period in your data and your actual scenario is as simple as your sample, then you can just eliminate all rows that contain '.'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE WANT AS 
   SELECT FirmID, 
          Name
      FROM HAVE
      WHERE (Name NOT CONTAINS '.');
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 07:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607920#M17604</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-28T07:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: same person with different name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607970#M17607</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202889"&gt;@dapenDaniel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply. I have revised my question.&amp;nbsp;The logic is if one name (like Bloomgerg, Jack B.) is contained in the full name (like Bloomberg, Jack Beta) in the same company, then delete the short name and keep the completed name.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe this is a language problem, but&lt;/P&gt;
&lt;PRE&gt;Bloomberg, Jack B.&lt;/PRE&gt;
&lt;P&gt;is not part of&lt;/P&gt;
&lt;PRE&gt;Bloomberg, Jack Beta&lt;/PRE&gt;
&lt;P&gt;At least not, if punctuation marks are not removed before comparison.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 06:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-person-with-different-name/m-p/607970#M17607</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-11-28T06:32:38Z</dc:date>
    </item>
  </channel>
</rss>

