<?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 extract 'dd' word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532300#M145853</link>
    <description>&lt;P&gt;There are many examples in the search results and I have 2&amp;nbsp; results that will assist you. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Extracting-word-from-string/m-p/320572#M42293" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Extracting-word-from-string/m-p/320572#M42293&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/how-to-extract-key-words-from-variables/m-p/527321#M5262" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/how-to-extract-key-words-from-variables/m-p/527321#M5262&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Feb 2019 17:32:59 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2019-02-02T17:32:59Z</dc:date>
    <item>
      <title>how to extract 'dd' word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532292#M145850</link>
      <description>&lt;P&gt;data ex1;&lt;BR /&gt;name='aaa234bbb$&amp;amp;#^#*abrrtbbrtbbb';&lt;BR /&gt;output;&lt;BR /&gt;name='harbbdgetbb' ;&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one dataset like see above dataset so how to extract 'bb' wherever the string has only 'bb' word(onlu two letters) pick that position&lt;/P&gt;&lt;P&gt;like see below dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;position&lt;/P&gt;&lt;P&gt;aaa234bbb$&amp;amp;#^#*abrrtbbrtbbb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21&lt;/P&gt;&lt;P&gt;harbbdgetbb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 17:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532292#M145850</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-02-02T17:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 'dd' word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532300#M145853</link>
      <description>&lt;P&gt;There are many examples in the search results and I have 2&amp;nbsp; results that will assist you. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Extracting-word-from-string/m-p/320572#M42293" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Extracting-word-from-string/m-p/320572#M42293&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/how-to-extract-key-words-from-variables/m-p/527321#M5262" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/how-to-extract-key-words-from-variables/m-p/527321#M5262&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 17:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532300#M145853</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-02T17:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 'dd' word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532303#M145855</link>
      <description>&lt;P&gt;You could use CALL SCAN() in a loop.&amp;nbsp; &amp;nbsp;Treat any character other than 'b' as a delimiter. Look at each "word" and stop when you find one that is length of 2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input name $50. ;
cards;
aaa234bbb$&amp;amp;#^#*abrrtbbrtbbb
harbbdgetbb
xxxbbyyy
bbzzz
none
;

data want ;
  set have;
  do i=1 by 1 until(len in (0,2)) ;
    pos=sum(pos,len,0);
    call scan(name,i,pos,len,compress(name,'b'));
  end;
  put (i pos len name) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;i=3 pos=21 len=2 name=aaa234bbb$&amp;amp;#^#*abrrtbbrtbbb
i=1 pos=4 len=2 name=harbbdgetbb
i=1 pos=4 len=2 name=xxxbbyyy
i=1 pos=1 len=2 name=bbzzz
i=1 pos=0 len=0 name=none&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Feb 2019 19:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532303#M145855</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-02T19:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 'dd' word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532304#M145856</link>
      <description>Thanq now I learnt one new thing</description>
      <pubDate>Sat, 02 Feb 2019 18:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532304#M145856</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-02-02T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 'dd' word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532306#M145857</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt; that is great you learn and acknowledge that please mark the solution that assist you thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 18:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-dd-word/m-p/532306#M145857</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-02T18:09:30Z</dc:date>
    </item>
  </channel>
</rss>

