<?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 Inner Join based on word in two variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667301#M199784</link>
    <description>&lt;P&gt;I have two tables and want to have inner join. The issue is I want to join where even one word is common where application name is common variable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Table one&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Application_Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOL Pune INDIA&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;UPI Mumbai&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOS India Ltd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;CISCO&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;REDHAT&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Infosys&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Table two&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Application_Name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;ETOS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;UPI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;CISCO DELHI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;IBM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;SYNTEL&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;WIPRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;STRONG&gt;I want to&amp;nbsp; have inner join even if one word in both the tables are common with below desired output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;UPI Mumbai&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOS India Ltd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;CISCO&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;I tried code&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Proc SQL;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Create table want as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;select a.application_name from one a inner join two b on&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;a.application_name contains b.application_name'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;But if i use contains I might miss Cisco in table B which has more words. I am looking for a solution where it should have inner join even if one word in both tables application_name matches..&lt;/FONT&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2020 21:32:11 GMT</pubDate>
    <dc:creator>sameer112217</dc:creator>
    <dc:date>2020-07-06T21:32:11Z</dc:date>
    <item>
      <title>Inner Join based on word in two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667301#M199784</link>
      <description>&lt;P&gt;I have two tables and want to have inner join. The issue is I want to join where even one word is common where application name is common variable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Table one&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Application_Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOL Pune INDIA&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;UPI Mumbai&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOS India Ltd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;CISCO&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;REDHAT&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Infosys&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Table two&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Application_Name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;ETOS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;UPI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;CISCO DELHI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;IBM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;SYNTEL&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;WIPRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;STRONG&gt;I want to&amp;nbsp; have inner join even if one word in both the tables are common with below desired output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;UPI Mumbai&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ETOS India Ltd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;CISCO&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;I tried code&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Proc SQL;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Create table want as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;select a.application_name from one a inner join two b on&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;a.application_name contains b.application_name'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;But if i use contains I might miss Cisco in table B which has more words. I am looking for a solution where it should have inner join even if one word in both tables application_name matches..&lt;/FONT&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 21:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667301#M199784</guid>
      <dc:creator>sameer112217</dc:creator>
      <dc:date>2020-07-06T21:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join based on word in two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667313#M199786</link>
      <description>&lt;P&gt;one way to do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
length app_name2  &amp;lt;samelength as application_name&amp;gt;;
set two;
if countc(application_name,' ') &amp;gt; 0 then do;
 app_name2=application_name
 do i = 1 to countc(application_name,' ')+1;
  application_name =strip(scan(app_name2,i,' '));
  output;
 end;
end;
else do;
output;
end;
run;
Proc SQL;

Create table want as

select a.application_name from one a inner join two b on

a.application_name contains b.application_name'&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jul 2020 23:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667313#M199786</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-06T23:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join based on word in two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667338#M199808</link>
      <description>&lt;P&gt;If the match should always use the first word in the string then something like below could work.&lt;/P&gt;
&lt;PRE&gt;scan(a.application_name,1) = scan(b.application_name,1)&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jul 2020 01:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667338#M199808</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-07-07T01:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join based on word in two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667414#M199856</link>
      <description>&lt;P&gt;a.application_name contains STRIP( b.application_name )&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;b.application_name contains STRIP( a.application_name )&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 11:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inner-Join-based-on-word-in-two-variables/m-p/667414#M199856</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-07T11:51:10Z</dc:date>
    </item>
  </channel>
</rss>

