<?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 SAS Tip: Use the CONTAINS Operator as an Alternative to the INDEX Function in SAS Tips from the Community</title>
    <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Use-the-CONTAINS-Operator-as-an-Alternative-to-the-INDEX/m-p/475750#M174</link>
    <description>&lt;P&gt;The CONTAINS or&amp;nbsp;? operator can be used to search a character variable for a user-specified string. This operator is case-sensitive, and can only be used within a WHERE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement. CONTAINS is similar to the index&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function, however, it does not provide the position of the character string within the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data steps below are equivalent. CONTAINS and&amp;nbsp;? are interchangeable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
    set sashelp.zipcode;
    where countynm contains 'z';
run;
 
data check;
    set sashelp.zipcode;
    where countynm ? 'z';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Thanks to&amp;nbsp;&lt;SPAN&gt;Mary Rosenbloom for posting this tip on sasCommunity.org!&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jul 2018 17:42:20 GMT</pubDate>
    <dc:creator>SAS_Tipster</dc:creator>
    <dc:date>2018-07-05T17:42:20Z</dc:date>
    <item>
      <title>SAS Tip: Use the CONTAINS Operator as an Alternative to the INDEX Function</title>
      <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Use-the-CONTAINS-Operator-as-an-Alternative-to-the-INDEX/m-p/475750#M174</link>
      <description>&lt;P&gt;The CONTAINS or&amp;nbsp;? operator can be used to search a character variable for a user-specified string. This operator is case-sensitive, and can only be used within a WHERE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement. CONTAINS is similar to the index&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function, however, it does not provide the position of the character string within the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data steps below are equivalent. CONTAINS and&amp;nbsp;? are interchangeable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
    set sashelp.zipcode;
    where countynm contains 'z';
run;
 
data check;
    set sashelp.zipcode;
    where countynm ? 'z';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Thanks to&amp;nbsp;&lt;SPAN&gt;Mary Rosenbloom for posting this tip on sasCommunity.org!&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 17:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Use-the-CONTAINS-Operator-as-an-Alternative-to-the-INDEX/m-p/475750#M174</guid>
      <dc:creator>SAS_Tipster</dc:creator>
      <dc:date>2018-07-05T17:42:20Z</dc:date>
    </item>
  </channel>
</rss>

