<?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 words in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746652#M234247</link>
    <description>&lt;P&gt;Please post the code you have including data in usable form (data step with datalines, no attachments).&lt;/P&gt;
&lt;P&gt;Using findw is the right choice.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jun 2021 05:09:19 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2021-06-09T05:09:19Z</dc:date>
    <item>
      <title>finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746639#M234237</link>
      <description>&lt;P&gt;I am using the following code to find the word DI. The code below returns true when it looks at "CREDIT". However I want it to return false, DI is in CREDIT, but I only want cases true when DI is a word. How do i achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if findw(field_to_search_from, 'DI') ge 1 then flag= 1;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jun 2021 07:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746639#M234237</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-06-09T07:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746645#M234242</link>
      <description>&lt;P&gt;I would use the FIND or FINDW functions to identify distinct words.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	_NULL_;
					*----+----1----+----2----+----3----+----4----+----5-;
	String		=	'In Army boot camp, the DI is in charge.';

	Position	=	FINDW(String, 'DI');

	PUTLOG  "The position is " Position 2.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Yields:&lt;/P&gt;
&lt;PRE&gt;The position is 24&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 02:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746645#M234242</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-09T02:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746652#M234247</link>
      <description>&lt;P&gt;Please post the code you have including data in usable form (data step with datalines, no attachments).&lt;/P&gt;
&lt;P&gt;Using findw is the right choice.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 05:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746652#M234247</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-06-09T05:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746676#M234257</link>
      <description>&lt;P&gt;try putting a space before and after&amp;nbsp;like&amp;nbsp;' DI '&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 06:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746676#M234257</guid>
      <dc:creator>Josie1</dc:creator>
      <dc:date>2021-06-09T06:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746677#M234258</link>
      <description>&lt;P&gt;But if CREDIT is the first word in the field_to_search_from then it wont have a space before it?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 07:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746677#M234258</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-06-09T07:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746679#M234260</link>
      <description>&lt;P&gt;not unless you write CRE DI T&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 07:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746679#M234260</guid>
      <dc:creator>Josie1</dc:creator>
      <dc:date>2021-06-09T07:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: finding words in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746707#M234273</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55595"&gt;@Josie1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;try putting a space before and after&amp;nbsp;like&amp;nbsp;' DI '&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not necessary if findw is used.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 10:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-words-in-sas/m-p/746707#M234273</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-06-09T10:11:15Z</dc:date>
    </item>
  </channel>
</rss>

