<?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: SQL to exclude records based on index function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329935#M271835</link>
    <description>&lt;P&gt;I think this might work better:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  select Exclude into :excludes separated by '|'
    from TableB
  ;
quit;

data tableC;
  set tableA;
  if prxmatch("m/&amp;amp;excludes./oi",software) = 0;
run;
&lt;/PRE&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Feb 2017 03:43:52 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-02-04T03:43:52Z</dc:date>
    <item>
      <title>SQL to exclude records based on index function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329866#M271833</link>
      <description>&lt;P&gt;I've got a table A with a field named&amp;nbsp;&amp;nbsp;Software.&amp;nbsp; Table B has a field called Exclude.&amp;nbsp; I'd like to chose all the records from A where the words to exclude are not part of the Software name.&amp;nbsp;&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" size="4"&gt;Table A&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Software&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Microsoft Office Visio&lt;/P&gt;
&lt;P&gt;Microsoft Office Word&lt;/P&gt;
&lt;P&gt;Adobe Photoshop&lt;/P&gt;
&lt;P&gt;Internet Explorer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" size="4"&gt;Table B&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Exclude&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Office&lt;/P&gt;
&lt;P&gt;House&lt;/P&gt;
&lt;P&gt;Barn&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would produce:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" size="4"&gt; Table C&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Software&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Adobe Photoshop&lt;/P&gt;
&lt;P&gt;Internet Explorer&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 18:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329866#M271833</guid>
      <dc:creator>SciFiGuy0</dc:creator>
      <dc:date>2017-02-03T18:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to exclude records based on index function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329868#M271834</link>
      <description>&lt;P&gt;This should do what you want for your example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table TableC as
   select distinct tableA.*
   from TableA, TableB
   where indexw(upcase(table.Software),upcase(TableB.Exclude))=0;
quit;
 
&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Feb 2017 18:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329868#M271834</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-03T18:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to exclude records based on index function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329935#M271835</link>
      <description>&lt;P&gt;I think this might work better:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  select Exclude into :excludes separated by '|'
    from TableB
  ;
quit;

data tableC;
  set tableA;
  if prxmatch("m/&amp;amp;excludes./oi",software) = 0;
run;
&lt;/PRE&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2017 03:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329935#M271835</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-04T03:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to exclude records based on index function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329983#M271836</link>
      <description>Havr you tried this kind of sql?&lt;BR /&gt;&lt;BR /&gt;Select a.*&lt;BR /&gt;From a left join b&lt;BR /&gt;On a.software contains trim( b.exclude)&lt;BR /&gt;Where b.exclude is null</description>
      <pubDate>Sat, 04 Feb 2017 22:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-exclude-records-based-on-index-function/m-p/329983#M271836</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-02-04T22:47:26Z</dc:date>
    </item>
  </channel>
</rss>

