<?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 check if column in one table is part of column in another table . in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777048#M247170</link>
    <description>&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;NOTE: The execution of this query involves performing one or more Cartesian product joins that can not be optimized.&lt;BR /&gt;NOTE: Table&amp;nbsp; created, with 0 rows and 2 columns.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 16:58:54 GMT</pubDate>
    <dc:creator>Sandhya55</dc:creator>
    <dc:date>2021-10-28T16:58:54Z</dc:date>
    <item>
      <title>How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777042#M247164</link>
      <description>&lt;P&gt;How to check if column in one table is part of column in another table .I have used Like keyword but it did not work.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777042#M247164</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T16:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777043#M247165</link>
      <description>More details please. &lt;BR /&gt;Like/FIND is usually the way.</description>
      <pubDate>Thu, 28 Oct 2021 16:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777043#M247165</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-28T16:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777044#M247166</link>
      <description>I have used like statement as below&lt;BR /&gt;PROC SQL ;&lt;BR /&gt;CREATE TABLE GRP1 AS&lt;BR /&gt;SELECT C.COMP_KEY, B.COMP_KEY AS GRP_COMP_KEY&lt;BR /&gt;FROM TB1 B , TB2 C&lt;BR /&gt;where B.COMP_KEY like '%'||C.COMP_KEY||'%' ;&lt;BR /&gt;QUIT;&lt;BR /&gt;But this is not working&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777044#M247166</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T16:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777045#M247167</link>
      <description>Can some one pls suggest&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777045#M247167</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T16:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777046#M247168</link>
      <description>What does not working mean? What do you have - very specifically what does your input data look like? &lt;BR /&gt;Can't share it due to privacy, please make fake data that replicates your problem.&lt;BR /&gt; What do you want to do? If that was your input data what do you expect as results?&lt;BR /&gt;&lt;BR /&gt;I see your code, but what does the log show?&lt;BR /&gt;&lt;BR /&gt;What about the following instead? FIND with the i/t makes it so that there case differences (upper/lower case) are ignored as are trailing blanks.&lt;BR /&gt;&lt;BR /&gt;PROC SQL ;&lt;BR /&gt;CREATE TABLE GRP1 AS&lt;BR /&gt;SELECT C.COMP_KEY, B.COMP_KEY AS GRP_COMP_KEY&lt;BR /&gt;FROM TB1 B , TB2 C&lt;BR /&gt;where find( B.COMP_KEY, c.comp_key, 'it')&amp;gt;0 ;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777046#M247168</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-28T16:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777047#M247169</link>
      <description>Below are the contents of&lt;BR /&gt;File A:&lt;BR /&gt;AAA BBBB CCC&lt;BR /&gt;DDD FF&lt;BR /&gt;File B :&lt;BR /&gt;BBB&lt;BR /&gt;DDD</description>
      <pubDate>Thu, 28 Oct 2021 16:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777047#M247169</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T16:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777048#M247170</link>
      <description>&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;NOTE: The execution of this query involves performing one or more Cartesian product joins that can not be optimized.&lt;BR /&gt;NOTE: Table&amp;nbsp; created, with 0 rows and 2 columns.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 16:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777048#M247170</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T16:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777049#M247171</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data TB1;

COMP_KEY="AAA BBBB CCC";output;
COMP_KEY="DDD FF";output;
run;

data tb2;
COMP_KEY="BBB";output;
COMP_KEY="DDD";output;
run;

PROC SQL ;
CREATE TABLE GRP1 AS
SELECT C.COMP_KEY, B.COMP_KEY AS GRP_COMP_KEY
FROM TB1 B , TB2 C
where B.COMP_KEY like '%'||C.COMP_KEY||'%' ;
QUIT;

PROC SQL ;
CREATE TABLE GRP2 AS
SELECT C.COMP_KEY, B.COMP_KEY AS GRP_COMP_KEY
FROM TB1 B , TB2 C
where find( B.COMP_KEY, c.comp_key, 'it')&amp;gt;0 ;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Both sets of code work fine for me given your example data and code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please generate a fully worked example, as above, that shows where this code isn't working.&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;
&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, 28 Oct 2021 17:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777049#M247171</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-28T17:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if column in one table is part of column in another table .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777059#M247175</link>
      <description>&lt;P&gt;Thanks !!! Find function worked for me ..probably my issue is with the trailing or leading spaces&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 17:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-if-column-in-one-table-is-part-of-column-in-another/m-p/777059#M247175</guid>
      <dc:creator>Sandhya55</dc:creator>
      <dc:date>2021-10-28T17:11:31Z</dc:date>
    </item>
  </channel>
</rss>

