<?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: Extract specific word from character variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485223#M126037</link>
    <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if find(var1,'IESTRESC')&amp;gt;0 then var1='IESTRESC';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Aug 2018 17:11:15 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-08-08T17:11:15Z</dc:date>
    <item>
      <title>Extract specific word from character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485220#M126035</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for way to extract the specific&amp;nbsp;word from character variables where specific word is present in other variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;one dataset has var1 variable and other dataset has var2 variables:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. var1: it has value "Missing variable: IESTRESC "&lt;/P&gt;&lt;P&gt;2. var2: it has value "IESTRESC"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I want to remove all other text and just keep "IESTRESC" in var1 variable. how should it be done?&lt;/P&gt;&lt;P&gt;NOTE: position of "IESTRESC" can be anywhere in var1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485220#M126035</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-08-08T17:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract specific word from character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485222#M126036</link>
      <description>&lt;P&gt;If you could present a nice comprehensive data sample of your dataset, that would help the community better&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meaning sample of both your datasets with values like 5 records each&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485222#M126036</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-08T17:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extract specific word from character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485223#M126037</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if find(var1,'IESTRESC')&amp;gt;0 then var1='IESTRESC';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485223#M126037</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T17:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract specific word from character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485225#M126038</link>
      <description>&lt;P&gt;Only one value? Or a bunch of values that you need to examine each value for possible occurrence in the variable?&lt;/P&gt;
&lt;P&gt;If you have more than one value to search for&amp;nbsp;is it possible that two or more may occur in the long value? If so what would the result look like then?&lt;/P&gt;
&lt;P&gt;Would that searched for value possibly occur as part of other words?&lt;/P&gt;
&lt;P&gt;Is the search value going to be case sensitive?&lt;/P&gt;
&lt;P&gt;And are there any spelling errors such that you have IESTRSC instead of IESTRESC that also need to match?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485225#M126038</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T17:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract specific word from character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485330#M126076</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; WANT&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; HAVE&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; find&lt;SPAN class="token punctuation"&gt;(VAR&lt;/SPAN&gt;1&lt;SPAN class="token punctuation"&gt;,VAR2,'t'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; VAR1&lt;SPAN class="token operator"&gt;=VAR2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 02:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-specific-word-from-character-variables/m-p/485330#M126076</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-08-09T02:04:35Z</dc:date>
    </item>
  </channel>
</rss>

