<?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: Searching conditional on substring? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/506062#M135589</link>
    <description>That's correct. My input code in the original post should have the column "Varname" instead of "VAR".&lt;BR /&gt;&lt;BR /&gt;Sorry for the mixup!</description>
    <pubDate>Fri, 19 Oct 2018 17:16:01 GMT</pubDate>
    <dc:creator>UniversitySas</dc:creator>
    <dc:date>2018-10-19T17:16:01Z</dc:date>
    <item>
      <title>Searching conditional on substring?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505353#M135317</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example; I am trying to keep records which only have the string "street" or "corn" in them, regardless of position/upper/lowercase or anything else - how would I go about doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data source;
INFILE DATALINES ;
 input ID VAR &amp;amp; $19. CLASSIFICATION $ ;
 DATALINES;
201  PepsiCo  XYZ  
201  111 main street  XYZ  
201  Charity  XYZ  
331  CocaCola  XYZ  
331  1823 unicorn street  XYZ  
331  Charity  XYZ  
331  Nike  XYZ  
331  123 brock avenue  XYZ  ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For instance:&amp;nbsp;I tried:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA substrings;
	SET source;
IF indexw(var,'street');
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but it creates an empty data set.&lt;BR /&gt;&lt;BR /&gt;any help is much appreciated, cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505353#M135317</guid>
      <dc:creator>UniversitySas</dc:creator>
      <dc:date>2018-10-17T21:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Searching conditional on substring?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505355#M135319</link>
      <description>&lt;P&gt;post a sample of your data&amp;nbsp; that's readable and what your required output plz&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505355#M135319</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-17T21:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Searching conditional on substring?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505358#M135321</link>
      <description>&lt;P&gt;Sorry - don't know why it didn't copy properly before - edited it now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Never mind, got it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA string;
	SET source;
WHERE varname contains 'street';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505358#M135321</guid>
      <dc:creator>UniversitySas</dc:creator>
      <dc:date>2018-10-17T21:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Searching conditional on substring?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505368#M135330</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/95638"&gt;@UniversitySas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry - don't know why it didn't copy properly before - edited it now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Never mind, got it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA string;
	SET source;
WHERE varname contains 'street';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does your data set contain a variable named VARNAME? Or are you attempting to use the VARNAME function. If the later then this won't work.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/505368#M135330</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-17T21:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Searching conditional on substring?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/506062#M135589</link>
      <description>That's correct. My input code in the original post should have the column "Varname" instead of "VAR".&lt;BR /&gt;&lt;BR /&gt;Sorry for the mixup!</description>
      <pubDate>Fri, 19 Oct 2018 17:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Searching-conditional-on-substring/m-p/506062#M135589</guid>
      <dc:creator>UniversitySas</dc:creator>
      <dc:date>2018-10-19T17:16:01Z</dc:date>
    </item>
  </channel>
</rss>

