<?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: FInding a word in a string and assigning it to a new variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721052#M223404</link>
    <description>&lt;P&gt;That sounds like it might work. I'm not familiar with how to do that. Can you point me in the right direction please? Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 20:36:55 GMT</pubDate>
    <dc:creator>joesmama</dc:creator>
    <dc:date>2021-02-22T20:36:55Z</dc:date>
    <item>
      <title>Finding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721014#M223391</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to search an 80 character variable in my dataset called PROCDUCT and categorize its contents. For example, I'd like to search PRODUCT for any of the words related to a book (paperback, volume, etc) and then create a new product variable that contains with word BOOK for that record. I've tried FIND and FINDW but its not returning the results I'm looking for.&amp;nbsp; What is the best way to go about this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 01:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721014#M223391</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-02-23T01:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721025#M223395</link>
      <description>One approach is to split each product to the word level, summarize and categorize the words according to PROC FREQ summaries and subject matter expertise and then add flags. You can then transpose the sentence back with the flags for the terms of interest. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721025#M223395</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-22T19:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721030#M223397</link>
      <description>&lt;P&gt;You could use regular expression matching, such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;isBook = prxMatch("/\b(paperback|volume|book\b/i", PRODUCT);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if isBook then productKind = "Book";&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721030#M223397</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-02-22T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721049#M223401</link>
      <description>&lt;P&gt;Thank you. I've tried that and it keeps coming back blank. I've tried with FINDW as well and that comes back blank or empty as well. Am I missing something? . Why would it come back as blank? Alsp, my string is actually 232 characters long. Appreciate your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 20:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721049#M223401</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-02-22T20:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721052#M223404</link>
      <description>&lt;P&gt;That sounds like it might work. I'm not familiar with how to do that. Can you point me in the right direction please? Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 20:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721052#M223404</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-02-22T20:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721093#M223422</link>
      <description>&lt;P&gt;Show us an example of what you tried. Regular expression matching is a great tool for dealing with text. It is worth spending the time to learn how it works.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 21:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721093#M223422</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-02-22T21:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: FInding a word in a string and assigning it to a new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721151#M223456</link>
      <description>&lt;P&gt;Looks like one of my parentheses was out of order. It worked like&amp;nbsp; a charm. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 01:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-word-in-a-string-and-assigning-it-to-a-new-variable/m-p/721151#M223456</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-02-23T01:01:35Z</dc:date>
    </item>
  </channel>
</rss>

