<?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: Fuzzy match with soundex and compged in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295567#M61785</link>
    <description>&lt;P&gt;My suggestion should have led to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data advisors;
length possible_match $3;
set ds1;
tmp1 = soundex(advisor);
possible_match = 'No';
do i = 1 to nobs;
	set ds2(rename = (advisor = advisor2)) point = i nobs = nobs;
	tmp2 = soundex(advisor2);
	dif = compged(tmp1, tmp2);
	if dif &amp;lt;= 100 then do;
		possible_match = 'Yes';
		output;
		end;
	end;
if possible_match = 'No' then do;
	advisor2 = advisor;
	output;
	end;
drop i tmp1 tmp2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 Aug 2016 16:46:16 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-08-31T16:46:16Z</dc:date>
    <item>
      <title>Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295334#M61710</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two datasets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;ds1&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Advisor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan_Chase___Co&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan_Secs__Asia&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan_Securities&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lehman_Brothers&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lehman_Brothers_Kuhn&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Laidlaw___Co__UK__Lt&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Laidlaw_Adams___Peck&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Laidlaw_Ansbacher&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Laidlaw_Equities_Inc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital__U&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Ad&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Gr&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Pa&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ds2&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Advisor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Laidlaw&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Lehman_Brothers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code below using soundex and compged ( I set a threshold level of 100 for the compged) I get the outcome given below the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data advisors;&lt;BR /&gt;set ds1;&lt;BR /&gt;tmp1=soundex(advisor);&lt;BR /&gt;do i=1 to nobs;&lt;BR /&gt;set ds2(rename=(advisor=advisor2)) point=i nobs=nobs;&lt;BR /&gt;tmp2=soundex(advisor2);&lt;BR /&gt;dif=compged(tmp1,tmp2);&lt;BR /&gt;if dif&amp;lt;=100 then do;&lt;BR /&gt;possible_match='Yes';&lt;BR /&gt;drop i tmp1 tmp2;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Advisor&lt;/TD&gt;&lt;TD&gt;advisor2&lt;/TD&gt;&lt;TD&gt;dif&lt;/TD&gt;&lt;TD&gt;possible_match&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JP_Morgan&lt;/TD&gt;&lt;TD&gt;JP_Morgan&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lehman_Brothers&lt;/TD&gt;&lt;TD&gt;Lehman_Brothers&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lehman_Brothers_Kuhn&lt;/TD&gt;&lt;TD&gt;Lehman_Brothers&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital__U&lt;/TD&gt;&lt;TD&gt;Macquarie_Capital&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Ad&lt;/TD&gt;&lt;TD&gt;Macquarie_Capital&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Gr&lt;/TD&gt;&lt;TD&gt;Macquarie_Capital&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Macquarie_Capital_Pa&lt;/TD&gt;&lt;TD&gt;Macquarie_Capital&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, say I want an output table which gives me all the 14 observations in ds1, gives 'yes' for possible match and the respective match from ds2 in the second column if the compegd is below the threshold and gives 'no' for possible match and a blank for the second column if the threshold is surpassed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to know how each observation in ds1 fairs with the matching and not to lose the observations because there wasn't a close match.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 21:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295334#M61710</guid>
      <dc:creator>aaou</dc:creator>
      <dc:date>2016-08-30T21:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295355#M61714</link>
      <description>&lt;P&gt;Add a bit more code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data advisors;
length possible_match $3;
set ds1;
tmp1=soundex(advisor);
possible_match='No';
do i=1 to nobs;
	set ds2(rename=(advisor=advisor2)) point=i nobs=nobs;
	tmp2=soundex(advisor2);
	dif=compged(tmp1,tmp2);
	if dif&amp;lt;=100 then do;
		possible_match='Yes';
		drop i tmp1 tmp2;
		output;
		end;
	end;
if possible_match='No' then do;
	call missing(advisor2);
	output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 00:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295355#M61714</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-31T00:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295385#M61716</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got a few&amp;nbsp;questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;1) Suppose instead of returning blank values ( when the compegd score is greater than the threshold value) I want the original name in DS1 to appear instead of the blank value; how should the code be amended?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I noticed that when I change the threshold score from 100 to say 500, the compegd scores change completely....why is that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) what is the meaning of this part of the code&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; possible_match &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to coding so I truly appreciate your help! Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 04:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295385#M61716</guid>
      <dc:creator>aaou</dc:creator>
      <dc:date>2016-08-31T04:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295527#M61774</link>
      <description>&lt;P&gt;1) Replace&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;call &lt;SPAN class="token function"&gt;missing&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;P&gt;advisor2 = advisor;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I don't know. You could submit this as a new&amp;nbsp;question to the Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Unless given explicitly, SAS determines the length of a character variable at the first assignment encountered during compilation. The length statement is to ensure that the variable possible_match isn't given a length of only two when the variable is first assigned the value "No".&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295527#M61774</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-31T14:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295542#M61777</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding your answer to questions (1); I thought that would work too, but when I do that the output I get generates blanks for the first column of advisors and the table gets messed up. I have attached a screenshot of the output.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12911i864CB1F272566B23/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="sas.png" title="sas.png" /&gt;</description>
      <pubDate>Wed, 31 Aug 2016 15:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295542#M61777</guid>
      <dc:creator>aaou</dc:creator>
      <dc:date>2016-08-31T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295553#M61779</link>
      <description>&lt;P&gt;Please post the new code.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 16:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295553#M61779</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-31T16:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295558#M61781</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; advisors&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; possible_match &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; ds1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
tmp1&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;soundex&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'No'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
do i&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; to nobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; ds2&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;rename&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;advisor2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;point&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;i nobs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;nobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	tmp2&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;soundex&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;compged&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;tmp1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;tmp2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;100&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Yes'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="token keyword"&gt;drop&lt;/SPAN&gt; i tmp1 tmp2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		output&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'No'&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	call &lt;SPAN class="token function"&gt;missing&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	output&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried this as I wasn't quite sure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; advisors&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; possible_match &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; ds1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
tmp1&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;soundex&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'No'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
do i&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; to nobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; ds2&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;rename&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;advisor2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;point&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;i nobs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;nobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	tmp2&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;soundex&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;compged&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;tmp1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;tmp2&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;100&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Yes'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="token keyword"&gt;drop&lt;/SPAN&gt; i tmp1 tmp2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		output&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; possible_match&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'No'&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	call &lt;SPAN class="token function"&gt;missing&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;advisor2=advisor&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	output&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Both didn't return what I wanted. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 16:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295558#M61781</guid>
      <dc:creator>aaou</dc:creator>
      <dc:date>2016-08-31T16:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fuzzy match with soundex and compged</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295567#M61785</link>
      <description>&lt;P&gt;My suggestion should have led to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data advisors;
length possible_match $3;
set ds1;
tmp1 = soundex(advisor);
possible_match = 'No';
do i = 1 to nobs;
	set ds2(rename = (advisor = advisor2)) point = i nobs = nobs;
	tmp2 = soundex(advisor2);
	dif = compged(tmp1, tmp2);
	if dif &amp;lt;= 100 then do;
		possible_match = 'Yes';
		output;
		end;
	end;
if possible_match = 'No' then do;
	advisor2 = advisor;
	output;
	end;
drop i tmp1 tmp2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 16:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295567#M61785</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-31T16:46:16Z</dc:date>
    </item>
  </channel>
</rss>

