<?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 Merge data sets without exact match but with LIKE match in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669831#M200991</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to merge data set aaa and data set bbb&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;I want to check if any value of column Team in data set aaa exists in data set bbb.&lt;/P&gt;
&lt;P&gt;The way of checking is:&lt;/P&gt;
&lt;P&gt;step1- delete blanks (before,between and after ) in column Team in data seta aaa&amp;nbsp;&lt;/P&gt;
&lt;P&gt;step2- delete blanks (before,between and after ) in column Team in data seta bbb&lt;/P&gt;
&lt;P&gt;Step3- check if calculated&amp;nbsp; Team column in data set aaa&amp;nbsp; exists in data set b&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data aaa;
input  team $ 1-20;
cards;
London
Tel aviv
Berlin
Warsaw
Tokyo
;
Run;

Data bbb;
input  team $ 1-20;
cards;
Inc London city
Telaviv
Western Berlin 
;
Run;

 
data aaa_new;
set aaa;
team_new=COMPRESS(team);
drop team;
rename team_new=team;
run;


data bbb_new;
set bbb;
team_new=COMPRESS(team);
drop team;
rename team_new=team;
run;
&lt;/CODE&gt;&lt;/PRE&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>Thu, 16 Jul 2020 08:15:56 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-07-16T08:15:56Z</dc:date>
    <item>
      <title>Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669831#M200991</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to merge data set aaa and data set bbb&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;I want to check if any value of column Team in data set aaa exists in data set bbb.&lt;/P&gt;
&lt;P&gt;The way of checking is:&lt;/P&gt;
&lt;P&gt;step1- delete blanks (before,between and after ) in column Team in data seta aaa&amp;nbsp;&lt;/P&gt;
&lt;P&gt;step2- delete blanks (before,between and after ) in column Team in data seta bbb&lt;/P&gt;
&lt;P&gt;Step3- check if calculated&amp;nbsp; Team column in data set aaa&amp;nbsp; exists in data set b&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data aaa;
input  team $ 1-20;
cards;
London
Tel aviv
Berlin
Warsaw
Tokyo
;
Run;

Data bbb;
input  team $ 1-20;
cards;
Inc London city
Telaviv
Western Berlin 
;
Run;

 
data aaa_new;
set aaa;
team_new=COMPRESS(team);
drop team;
rename team_new=team;
run;


data bbb_new;
set bbb;
team_new=COMPRESS(team);
drop team;
rename team_new=team;
run;
&lt;/CODE&gt;&lt;/PRE&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>Thu, 16 Jul 2020 08:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669831#M200991</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-07-16T08:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669834#M200992</link>
      <description>&lt;P&gt;Should&amp;nbsp; &lt;EM&gt;Berlin &amp;nbsp;&lt;/EM&gt;match&amp;nbsp; &lt;EM&gt;Western Berlin&amp;nbsp;&lt;/EM&gt; ?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 08:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669834#M200992</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-16T08:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669836#M200994</link>
      <description>&lt;P&gt;Please use the search-function, partial matching has been discussed many times, you should be able to adapt one of the solutions.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 08:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669836#M200994</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-16T08:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669841#M200997</link>
      <description>&lt;P&gt;Yes, because name Berlin included in name West Berlin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 09:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669841#M200997</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-07-16T09:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669844#M200998</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try as follows :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data aaa;
input  team $ 1-20;
cards;
London
Tel aviv
Berlin
Warsaw
Tokyo
;
Run;

Data bbb;
input  team $ 1-20;
cards;
Inc London city
Telaviv
Western Berlin 
;
Run;

proc sql noprint;
  CREATE TABLE want AS
  SELECT a.team, b.team AS team_b
  FROM aaa a
  LEFT JOIN bbb b
  ON compress(b.team) CONTAINS compress(a.team)
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jul 2020 09:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669844#M200998</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2020-07-16T09:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets without exact match but with LIKE match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669848#M200999</link>
      <description>&lt;P&gt;Or, to have more matches:&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 unique a.team, b.team AS team_b
  FROM      aaa a
  LEFT JOIN bbb b
  ON find(compress(b.team), compress(a.team), 'i')
   | find(compress(a.team), compress(b.team), 'i') ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 10:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-without-exact-match-but-with-LIKE-match/m-p/669848#M200999</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-16T10:04:35Z</dc:date>
    </item>
  </channel>
</rss>

