<?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: How to find similar and equal values in one column and then another column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696506#M212759</link>
    <description>The only blank field possible would be the ID</description>
    <pubDate>Wed, 04 Nov 2020 13:47:21 GMT</pubDate>
    <dc:creator>fcf</dc:creator>
    <dc:date>2020-11-04T13:47:21Z</dc:date>
    <item>
      <title>How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696456#M212737</link>
      <description>&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;num_A&lt;/TD&gt;&lt;TD&gt;num_B&lt;/TD&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;TD&gt;birth_date&lt;/TD&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;abcd&lt;/TD&gt;&lt;TD&gt;M Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;uvwx&lt;/TD&gt;&lt;TD&gt;M Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5678&lt;/TD&gt;&lt;TD&gt;efgh&lt;/TD&gt;&lt;TD&gt;Maria Rita C Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9101&lt;/TD&gt;&lt;TD&gt;ijkl&lt;/TD&gt;&lt;TD&gt;Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;mnop&lt;/TD&gt;&lt;TD&gt;Maria Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;02/03/2001&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;qrst&lt;/TD&gt;&lt;TD&gt;Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;02/03/2001&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4444&lt;/TD&gt;&lt;TD&gt;yzab&lt;/TD&gt;&lt;TD&gt;Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;30/08/1999&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imagine I have this table, but in a large scale. I want to find similar and equal values in the name column and if they are similar/equal, go to the column birth_date and see if they are equal. If yes, create the same id for this cases. So i want the final output to be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;num_A&lt;/TD&gt;&lt;TD&gt;num_B&lt;/TD&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;TD&gt;birth_date&lt;/TD&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;abcd&lt;/TD&gt;&lt;TD&gt;M Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;uvwx&lt;/TD&gt;&lt;TD&gt;M Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5678&lt;/TD&gt;&lt;TD&gt;efgh&lt;/TD&gt;&lt;TD&gt;Maria Rita C Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9101&lt;/TD&gt;&lt;TD&gt;ijkl&lt;/TD&gt;&lt;TD&gt;Rita Costa Santos&lt;/TD&gt;&lt;TD&gt;01/01/2000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;mnop&lt;/TD&gt;&lt;TD&gt;Maria Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;02/03/2001&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;qrst&lt;/TD&gt;&lt;TD&gt;Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;02/03/2001&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4444&lt;/TD&gt;&lt;TD&gt;yzab&lt;/TD&gt;&lt;TD&gt;Leonor Santos Silva&lt;/TD&gt;&lt;TD&gt;30/08/1999&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 12:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696456#M212737</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696464#M212740</link>
      <description>&lt;P&gt;Can you describe further what you mean by "similar"?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 12:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696464#M212740</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-04T12:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696466#M212741</link>
      <description>&lt;P&gt;What does 'similar' mean here? That eg the spelling distance is not far from each other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is the data sorted by these 'likewise' names?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 12:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696466#M212741</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T12:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696475#M212745</link>
      <description>Similar, like in the examples. For example, the birth_date is the same for these:&lt;BR /&gt;- Maria Rita Costa Santos&lt;BR /&gt;&lt;BR /&gt;- M Rita Costa Santos, the M is an abbreviation for Maria&lt;BR /&gt;&lt;BR /&gt;- Rita Costa Santos - because Maria is such a popular name, the person chooses to only say the second name, which is less common.&lt;BR /&gt;&lt;BR /&gt;However, these are all the same person, but just wrote the name in different ways. However, in the last two examples, people can have the same name and be different people (check the birth date).</description>
      <pubDate>Wed, 04 Nov 2020 12:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696475#M212745</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T12:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696477#M212746</link>
      <description>Please read what I answered to draycut, it was the same question. Thank you!</description>
      <pubDate>Wed, 04 Nov 2020 12:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696477#M212746</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696478#M212747</link>
      <description>&lt;P&gt;And you already have the ID for some of the obs? But not all, correct?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 12:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696478#M212747</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T12:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696479#M212748</link>
      <description>yes, not all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; the point is to have the ids according to the same people, so I can group the data correctly</description>
      <pubDate>Wed, 04 Nov 2020 12:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696479#M212748</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T12:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696490#M212753</link>
      <description>&lt;P&gt;Ok. Is your data sorted like this? Or could&amp;nbsp;&lt;SPAN&gt;M Rita Costa Santos have an observation at the bottom?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696490#M212753</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T13:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696492#M212755</link>
      <description>&lt;P&gt;It is not sorted. I just showed this so it would be easier to understand. I have like 12 000 records of names.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696492#M212755</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696498#M212756</link>
      <description>&lt;P&gt;Can a person have no ID with a pre-assigned value?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696498#M212756</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T13:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696499#M212757</link>
      <description>Can you elaborate please?</description>
      <pubDate>Wed, 04 Nov 2020 13:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696499#M212757</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T13:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696502#M212758</link>
      <description>&lt;P&gt;The posted data you have is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines missover;
input num_A num_B $ name $ 11-36 birth_date :ddmmyy10. id;
format birth_date ddmmyy10.;
datalines;
1234 abcd M Rita Costa Santos        01/01/2000 1 
3333 uvwx M Rita Costa Santos        01/01/2000 1 
5678 efgh Maria Rita C Santos        01/01/2000   
9101 ijkl Rita Costa Santos          01/01/2000 1 
1111 mnop Maria Leonor Santos Silva  02/03/2001   
2222 qrst Leonor Santos Silva        02/03/2001 2 
4444 yzab Leonor Santos Silva        30/08/1999   
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can a situation arise, where a person in your data have no ID attached to &lt;EM&gt;any&amp;nbsp;&lt;/EM&gt;of its observations? See the two last obs in the data below (no ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines missover;
input num_A num_B $ name $ 11-36 birth_date :ddmmyy10. id;
format birth_date ddmmyy10.;
datalines;
1234 abcd M Rita Costa Santos        01/01/2000 1 
3333 uvwx M Rita Costa Santos        01/01/2000 1 
5678 efgh Maria Rita C Santos        01/01/2000   
9101 ijkl Rita Costa Santos          01/01/2000 1 
1111 mnop Maria Leonor Santos Silva  02/03/2001   
2222 qrst Leonor Santos Silva        02/03/2001 2 
4444 yzab Leonor Santos Silva        30/08/1999   
xxxx xxxx Some Name Here             01/01/1960   
xxxx xxxx Some Name Here             01/01/1960   
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696502#M212758</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T13:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696506#M212759</link>
      <description>The only blank field possible would be the ID</description>
      <pubDate>Wed, 04 Nov 2020 13:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696506#M212759</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T13:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696514#M212761</link>
      <description>&lt;P&gt;I will try to make myself more clear. Consider the data below. This is the same data that you posted plus an additional person.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the two people in your initial data both have a pre-assigned ID (the one we want to hit for the remaining obs for those people), "Donald J Trump" does not. He is obviously not equal to either id=1 or id=2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can this situation happen in your data? And then what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines missover;
input num_A num_B $ name $ 11-36 birth_date :ddmmyy10. id;
format birth_date ddmmyy10.;
datalines;
1234 abcd M Rita Costa Santos        01/01/2000 1 
3333 uvwx M Rita Costa Santos        01/01/2000 1 
5678 efgh Maria Rita C Santos        01/01/2000   
9101 ijkl Rita Costa Santos          01/01/2000 1 
1111 mnop Maria Leonor Santos Silva  02/03/2001   
2222 qrst Leonor Santos Silva        02/03/2001 2 
4444 yzab Leonor Santos Silva        30/08/1999   
xxxx xxxx Donald J Trump             01/01/1960   
xxxx xxxx Donald J Trump             01/01/1960   
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696514#M212761</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T13:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696515#M212762</link>
      <description>Ah yes, it can happen. That's why I gave the last example of a Leonor born in another date, which will have an id 3. The Donald Trump should be the id 4 for example.</description>
      <pubDate>Wed, 04 Nov 2020 14:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696515#M212762</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T14:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696518#M212765</link>
      <description>Another way is to create another column with all the IDs, instead of putting the id in the same column</description>
      <pubDate>Wed, 04 Nov 2020 14:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696518#M212765</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-04T14:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696825#M212913</link>
      <description>&lt;P&gt;Ok. This should do it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The overall logic is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Load the observations &lt;EM&gt;with&amp;nbsp;&lt;/EM&gt;id's into two lookup tables. One keyed by name and birth_date. The other keyed by just birth_date.&lt;/LI&gt;
&lt;LI&gt;Read all data sequentially.&lt;/LI&gt;
&lt;LI&gt;If ID is missing, look in the first table h1 for an exact match on name and birth_date. If not found, look in the second table h2 on all entries with the desired birth_date. If one of the names in h2 is &lt;STRONG&gt;appropriately close&lt;/STRONG&gt; to the original name, set the ID to the lookup value of ID.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Add the 'new' name to h2.&lt;/LI&gt;
&lt;LI&gt;If Id is still missing and not filled by either lookup above, set ID to (maximum value of ID + 1).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By&amp;nbsp;&lt;STRONG&gt;appropriately close&lt;/STRONG&gt;, I used the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n0l41pdemybegln1oetsh4cctdap.htm&amp;amp;locale=en" target="_self"&gt;Complev Function&lt;/A&gt; and simply chose a value that works for this example. Ie here, the distance should be less than ten to be considered 'similar'. You may have to adjust that part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/355489"&gt;@fcf&lt;/a&gt;&amp;nbsp;Let me know if it works for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines missover;
input num_A num_B $ name $ 11-36 birth_date :ddmmyy10. id;
format birth_date ddmmyy10.;
datalines;
1234 abcd M Rita Costa Santos        01/01/2000 1 
3333 uvwx M Rita Costa Santos        01/01/2000 1 
5678 efgh Maria Rita C Santos        01/01/2000   
9101 ijkl Rita Costa Santos          01/01/2000 1 
1111 mnop Maria Leonor Santos Silva  02/03/2001   
2222 qrst Leonor Santos Silva        02/03/2001 2 
4444 yzab Leonor Santos Silva        30/08/1999   
;

data want(keep = num_A num_B name birth_date id);
   format num_A num_B name birth_date id;
   if _N_ = 1 then do;
      dcl hash h1 ();
      h1.definekey("name", "birth_date");
      h1.definedata("i");
      h1.definedone();

      dcl hash h2 (multidata : "Y");
      h2.definekey("birth_date");
      h2.definedata("n", "i");
      h2.definedone();

      do until (z);
         set have(rename=(id=i name=n) where = (i)) end = z;
         h1.ref();
         h2.ref();
         maxid = max(maxid, i);
      end;
   end;

   set have;

   if id = . then do;
      if h1.find() ne 0 then do;
         do while (h2.do_over() = 0);
            if complev(name, n) &amp;lt; 10 then do;
               id = i;
               h1.ref(key : n, key : birth_date, data : id);
            end;
         end;
      end;
   end;

   if id = . then do;
      maxid + 1;
      id = maxid;
      h1.ref(key : name, key : birth_date, data : id);
   end;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;num_A num_B name                       birth_date  id 
1234  abcd  M Rita Costa Santos        01/01/2000  1 
3333  uvwx  M Rita Costa Santos        01/01/2000  1 
5678  efgh  Maria Rita C Santos        01/01/2000  1 
9101  ijkl  Rita Costa Santos          01/01/2000  1 
1111  mnop  Maria Leonor Santos Silva  02/03/2001  2 
2222  qrst  Leonor Santos Silva        02/03/2001  2 
4444  yzab  Leonor Santos Silva        30/08/1999  3 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 11:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/696825#M212913</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-05T11:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700151#M214254</link>
      <description>Hi draycut! I'm sorry for taking so long to reply. It did not worked. Maybe because I may not have the same people in the following records(?) So the names might be scattered all over the table. I'm guessing that's why it is not working... I don't know...</description>
      <pubDate>Thu, 19 Nov 2020 10:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700151#M214254</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-19T10:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700161#M214258</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/355489"&gt;@fcf&lt;/a&gt;&amp;nbsp;you have to be more specific than "It did not work". What did not work? How did the result differ from what you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code works regardless of the order on your data. That is not why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post a larger sample of your actual data and let me take a look.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 11:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700161#M214258</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-19T11:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to find similar and equal values in one column and then another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700162#M214259</link>
      <description>&lt;P&gt;I cannot post the actual data. It is private. It did not work - it always returned a different id.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 11:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-similar-and-equal-values-in-one-column-and-then/m-p/700162#M214259</guid>
      <dc:creator>fcf</dc:creator>
      <dc:date>2020-11-19T11:19:15Z</dc:date>
    </item>
  </channel>
</rss>

