<?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 string that varies in length and number of delimiters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460580#M117078</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var $80.;
call scan(var,-1,position, length,' ');
k1=index(var,')');
need= substr(var,index(var,')')+1,position-k1-1);
drop k: position length;
cards;
AE: (6) urinary tract infection 22-NOV-2017
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 May 2018 22:17:05 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-05-07T22:17:05Z</dc:date>
    <item>
      <title>extract string that varies in length and number of delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460579#M117077</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have values that consistently are in this type of layout- (that is&amp;nbsp; a wanted character string between ( x) and a (char date.)..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AE: (6) urinary tract infection 22-NOV-2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to&amp;nbsp; just extract the 'urinary tract infection' to a new variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help is appreciated!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 21:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460579#M117077</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-07T21:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: extract string that varies in length and number of delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460580#M117078</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var $80.;
call scan(var,-1,position, length,' ');
k1=index(var,')');
need= substr(var,index(var,')')+1,position-k1-1);
drop k: position length;
cards;
AE: (6) urinary tract infection 22-NOV-2017
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 22:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460580#M117078</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-07T22:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: extract string that varies in length and number of delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460586#M117081</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp; thank you!&amp;nbsp; HUGE help!!!&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 22:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460586#M117081</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-07T22:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: extract string that varies in length and number of delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460604#M117089</link>
      <description>&lt;P&gt;If you data looks like the example you showed i.e. you have lowercase for the string you want to extract remaning other than lowercase then you can use COMPRESS() function with "k" (&lt;SPAN&gt;keeps the characters in the list instead of removing them)&lt;/SPAN&gt; and "l" modifier (adding lowercase to list).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
STRING="AE: (6) urinary tract infection 22-NOV-2017";
Want_Str=STRIP(COMPRESS(STRING,"","kl"));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 May 2018 00:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460604#M117089</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-08T00:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: extract string that varies in length and number of delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460618#M117097</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59697"&gt;@jenim514&lt;/a&gt;&amp;nbsp; You could mark the question as answered and close the thread&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 03:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-string-that-varies-in-length-and-number-of-delimiters/m-p/460618#M117097</guid>
      <dc:creator>Andygray</dc:creator>
      <dc:date>2018-05-08T03:23:06Z</dc:date>
    </item>
  </channel>
</rss>

