<?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 Searching for multiple character strings within a var in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82395#M543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am working on an automotive client digging through their service data, and all they have provided is VIN level information with a single variable containing all work done on that Repair Order.&amp;nbsp; I am searching for Brake Replacements, but this variable is free text for the service tech to write in whatever he or she would like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have 17.2 M records, of which I need to search for about 20 iterations, "Front Brake Pad" or "Rear Brake" or "Turn Rotor" or the like.&amp;nbsp; I have these set up in a %LET statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;%LET Brakes = 'REPLACE FRONT BRAKE','REPLACE REAR BRAKE','TURN ROTOR','SURFACE BRAKE DRUM','MACHINE BRAKE ROTORS' ... ;&lt;/P&gt;&lt;P&gt;IF INDEXW(Description,&amp;amp;Brakes.) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INDEX only searches for one string&lt;/P&gt;&lt;P&gt;INDEXC&amp;nbsp; only will search for the first character in the string&lt;/P&gt;&lt;P&gt;INDEXW and FINDW says my string contains too many arguments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest how I can look at this, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2013 18:28:36 GMT</pubDate>
    <dc:creator>That____Redhead</dc:creator>
    <dc:date>2013-01-22T18:28:36Z</dc:date>
    <item>
      <title>Searching for multiple character strings within a var</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82395#M543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am working on an automotive client digging through their service data, and all they have provided is VIN level information with a single variable containing all work done on that Repair Order.&amp;nbsp; I am searching for Brake Replacements, but this variable is free text for the service tech to write in whatever he or she would like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have 17.2 M records, of which I need to search for about 20 iterations, "Front Brake Pad" or "Rear Brake" or "Turn Rotor" or the like.&amp;nbsp; I have these set up in a %LET statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;%LET Brakes = 'REPLACE FRONT BRAKE','REPLACE REAR BRAKE','TURN ROTOR','SURFACE BRAKE DRUM','MACHINE BRAKE ROTORS' ... ;&lt;/P&gt;&lt;P&gt;IF INDEXW(Description,&amp;amp;Brakes.) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INDEX only searches for one string&lt;/P&gt;&lt;P&gt;INDEXC&amp;nbsp; only will search for the first character in the string&lt;/P&gt;&lt;P&gt;INDEXW and FINDW says my string contains too many arguments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest how I can look at this, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82395#M543</guid>
      <dc:creator>That____Redhead</dc:creator>
      <dc:date>2013-01-22T18:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for multiple character strings within a var</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82396#M544</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;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set your_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF prxmatch('m/brake/oi', &lt;STRONG&gt;your_var&lt;/STRONG&gt;) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set your_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;*also keep the record that has 'turn rotor', or 'surface drum', or....(which you tell SAS by using the | delimiter);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF prxmatch('m/brake|turn rotor| surface drum/oi', &lt;STRONG&gt;your_var&lt;/STRONG&gt;) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82396#M544</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-01-22T18:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for multiple character strings within a var</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82397#M545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Anca,&lt;/P&gt;&lt;P&gt;I'm still getting the space error - I have 18 text strings I am searching for, and it's about 350 characters long.&amp;nbsp; I'll just use this and shorten it into two PRXMATCH functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Searching-for-multiple-character-strings-within-a-var/m-p/82397#M545</guid>
      <dc:creator>That____Redhead</dc:creator>
      <dc:date>2013-01-22T18:44:02Z</dc:date>
    </item>
  </channel>
</rss>

