<?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: How to check words (from one column) in text (from another column) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80872#M17413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Scott and PGStats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Sep 2013 16:47:11 GMT</pubDate>
    <dc:creator>krishmar1</dc:creator>
    <dc:date>2013-09-13T16:47:11Z</dc:date>
    <item>
      <title>How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80867#M17408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Hi,&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;I have a dataset A with a column named &lt;STRONG&gt;Location&lt;/STRONG&gt; and a dataset B with a column named &lt;STRONG&gt;Keyword&lt;/STRONG&gt;.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Location has rows like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Texas&lt;/LI&gt;&lt;LI&gt;Florida&lt;/LI&gt;&lt;LI&gt;Arizona&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;which stores any single word.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Keyword stores rows with text, for example: I live in Florida.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;I would like to list all the rows in Keyword if any of the words in location exists in Keyword.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;So keyword in the above example would be listed but not if the row of Keyword is "I am a vagabond"&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;How do I code this in SAS --- using a data step or Proc SQL or any other proc?&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Please help!&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Thanks,&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 21:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80867#M17408</guid>
      <dc:creator>krishmar1</dc:creator>
      <dc:date>2013-09-12T21:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80868#M17409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T1;&lt;/P&gt;&lt;P&gt;INPUT&amp;nbsp; LOCATION $;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;TEXAS&lt;/P&gt;&lt;P&gt;FLORIDA&lt;/P&gt;&lt;P&gt;ARIZONA&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T2;&lt;/P&gt;&lt;P&gt;LENGTH KEYWORD $40;&lt;/P&gt;&lt;P&gt;INFILE DATALINES DLM=',';&lt;/P&gt;&lt;P&gt;INPUT KEYWORD $;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;I AM A VAGABOND&lt;/P&gt;&lt;P&gt;I LOVE TEXAS&lt;/P&gt;&lt;P&gt;I HATE ARIZONA&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE WANT AS&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM T1,T2&lt;/P&gt;&lt;P&gt;WHERE FIND(T2.KEYWORD,T1.LOCATION) &amp;gt; 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 01:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80868#M17409</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-13T01:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80869#M17410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Scott. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how I can have an indicator variable (binary) for each row where &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FIND(T2.KEYWORD,T1.LOCATION) &amp;gt; 0 so that I can differentiate between the rows with the location and the rows without&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 02:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80869#M17410</guid>
      <dc:creator>krishmar1</dc:creator>
      <dc:date>2013-09-13T02:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80870#M17411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the last step to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC SQL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TABLE WANT AS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T2.keyword, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T1.location, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T1.location IS NOT MISSING as indicator&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM T2 LEFT JOIN T1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ON FIND(T2.KEYWORD ,T1.LOCATION) &amp;gt; 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUIT;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 03:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80870#M17411</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-09-13T03:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80871#M17412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE WANT AS&lt;/P&gt;&lt;P&gt;SELECT A.KEYWORD, B.INDIC&lt;/P&gt;&lt;P&gt;FROM T2 A&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;/P&gt;&lt;P&gt;(SELECT KEYWORD, 1 AS INDIC&lt;/P&gt;&lt;P&gt;FROM T1,T2&lt;/P&gt;&lt;P&gt;WHERE FIND(T2.KEYWORD,T1.LOCATION) &amp;gt; 0) B&lt;/P&gt;&lt;P&gt;ON A.KEYWORD = B.KEYWORD&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 03:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80871#M17412</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-13T03:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to check words (from one column) in text (from another column)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80872#M17413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Scott and PGStats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 16:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-words-from-one-column-in-text-from-another-column/m-p/80872#M17413</guid>
      <dc:creator>krishmar1</dc:creator>
      <dc:date>2013-09-13T16:47:11Z</dc:date>
    </item>
  </channel>
</rss>

