<?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: &amp;quot;CONTAINS&amp;quot; Join Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49103#M13320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your inner join should have matches. If it doesn't because the SKU's are formatted different ie leading zeroes that's a different issue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try an exists or in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from table1 &lt;/P&gt;&lt;P&gt;where sku in (select sku from table2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or format within the query (can also within the join)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from table1 &lt;/P&gt;&lt;P&gt;where sku in (select put(sku, z10.) from table2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2012 20:40:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-03-29T20:40:29Z</dc:date>
    <item>
      <title>"CONTAINS" Join Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49102#M13319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simple query...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1 has a million SKUs (ie 006631251252)&lt;/P&gt;&lt;P&gt;Table 2 has a unique list of SKUs (663125125)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As in the example above, the SKU in table 2 can be contained in the SKU from table 1. If I do an inner join on the two tables above, there would be no match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a join such that there is a match if Table 2 SKUs are contained in Table 1. I think the CONTAINS function is what needs to be used, but not sure how to do a join using CONTAINS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;James&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 20:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49102#M13319</guid>
      <dc:creator>Habs4Life</dc:creator>
      <dc:date>2012-03-29T20:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: "CONTAINS" Join Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49103#M13320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your inner join should have matches. If it doesn't because the SKU's are formatted different ie leading zeroes that's a different issue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try an exists or in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from table1 &lt;/P&gt;&lt;P&gt;where sku in (select sku from table2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or format within the query (can also within the join)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from table1 &lt;/P&gt;&lt;P&gt;where sku in (select put(sku, z10.) from table2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 20:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49103#M13320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-03-29T20:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: "CONTAINS" Join Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49104#M13321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from table1 as a,table2 as b&lt;/P&gt;&lt;P&gt;where a.sku contains strip(b.sku)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 03:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-CONTAINS-quot-Join-Question/m-p/49104#M13321</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-30T03:18:19Z</dc:date>
    </item>
  </channel>
</rss>

