<?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: Contains? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199768#M49912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even the following code does not work, in the beginning i tried the same but i wonder why the index is not working in this case.Any thoughts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(b,a)&amp;gt;0 then match=1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else match=0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2015 13:11:44 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2015-04-20T13:11:44Z</dc:date>
    <item>
      <title>Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199759#M49903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Hope anyone can help with this problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hava two colums (character), a and b like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: medium none; padding: 0px 5.4pt; width: 281px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;a&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;b&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to add a third variable (match) if column b contains the information in column a. Like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: medium none; padding: 0px 5.4pt; width: 281px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;a&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;b&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="59"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;match&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="59"&gt;&lt;P align="right" style="margin-bottom: 0.0001pt; text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="59"&gt;&lt;P align="right" style="margin-bottom: 0.0001pt; text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;1|2|3|4|5|6|7|8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="59"&gt;&lt;P align="right" style="margin-bottom: 0.0001pt; text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="86"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;2|3|4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="135"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: black;"&gt;0|1|2|3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="59"&gt;&lt;P align="right" style="margin-bottom: 0.0001pt; text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done with contains-function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 07:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199759#M49903</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2015-04-20T07:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199760#M49904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;if &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;index(strip(b),strip(a))&amp;gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;0&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;then &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;match=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;else &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;match=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 07:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199760#M49904</guid>
      <dc:creator>grimol</dc:creator>
      <dc:date>2015-04-20T07:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199761#M49905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Several ways really:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(a,b)&amp;gt;0 then match=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else match=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use Perl Regular Expressions.&amp;nbsp; Or the find() function.&amp;nbsp; Etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199761#M49905</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-20T08:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199762#M49906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A Forum where you can see the postings not until 6 hours after posting is..... useless.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:08:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199762#M49906</guid>
      <dc:creator>grimol</dc:creator>
      <dc:date>2015-04-20T08:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199763#M49907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the same but i am not sure why using index function, it is not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However with find function with trim modifier it is working &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input a :$10. b :$20.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;0|1|2|3|4 0|1|2|3|4|5|6|7|8&lt;/P&gt;&lt;P&gt;3|4 0|1|2|3|4|5|6|7|8&lt;/P&gt;&lt;P&gt;0|1|2|3|4 1|2|3|4|5|6|7|8&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if find(b,a,"t")&amp;gt;0 then match=1;&lt;/P&gt;&lt;P&gt;else match=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199763#M49907</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-04-20T08:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199764#M49908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;However, I cound not make thiscode work. Every match is 0&lt;/P&gt;&lt;P&gt;/T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199764#M49908</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2015-04-20T08:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199765#M49909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The find function is working. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199765#M49909</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2015-04-20T08:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199766#M49910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had it the wrong way round:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(b,a)&amp;gt;0 then match=1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else match=0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 08:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199766#M49910</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-20T08:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199767#M49911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 09:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199767#M49911</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2015-04-20T09:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199768#M49912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even the following code does not work, in the beginning i tried the same but i wonder why the index is not working in this case.Any thoughts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(b,a)&amp;gt;0 then match=1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else match=0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 13:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199768#M49912</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-04-20T13:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199769#M49913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tried with "strip()"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 13:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199769#M49913</guid>
      <dc:creator>grimol</dc:creator>
      <dc:date>2015-04-20T13:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199770#M49914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Blanks, that's the problem.&amp;nbsp; Using a variable means all the characters including suffix blanks are used:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; a="0|1|2|3|4"; b="0|1|2|3|4|5|6|7|8"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; a="3|4"; b="0|1|2|3|4|5|6|7|8"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tmp=index(b,strip(a));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the previous one, a refers to 3|4_____ with the underscores as blanks, so it isn't found.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 13:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199770#M49914</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-20T13:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199771#M49915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, that solves the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 13:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199771#M49915</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-04-20T13:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Contains?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199772#M49916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only because you're a new user, it's a spam control issue at the moment I believe. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 14:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Contains/m-p/199772#M49916</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-20T14:21:44Z</dc:date>
    </item>
  </channel>
</rss>

