<?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: Capture text string between two delimiters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541535#M149528</link>
    <description>I am a sas lover and trying to improove myself.&lt;BR /&gt;I really thanks to all of you. I learn new things from every replys, different ways...thanks again.</description>
    <pubDate>Fri, 08 Mar 2019 18:59:55 GMT</pubDate>
    <dc:creator>Yavuz</dc:creator>
    <dc:date>2019-03-08T18:59:55Z</dc:date>
    <item>
      <title>Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541507#M149515</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a variable with values all structured like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MHS7. VITAMIN D DEFICIENCY (ONSET DATE = UN UNK 2016)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to capture the 'VITAMIN D DEFICIENCY' only.&amp;nbsp; So the text string between the&amp;nbsp; ' . ' and the&amp;nbsp; &amp;nbsp;' ( '&lt;/P&gt;
&lt;P&gt;Is there a way to do this with a scan or some other way?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541507#M149515</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2019-03-08T18:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541509#M149517</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
str='MHS7. VITAMIN D DEFICIENCY (ONSET DATE = UN UNK 2016)';
pos1=findc(str, '.');
pos2=findc(str, '(');
Need=substr(str,Pos1+1,pos2-1-pos1);
drop pos:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541509#M149517</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-08T18:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541513#M149518</link>
      <description>&lt;P&gt;Another way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   str='MHS7. VITAMIN D DEFICIENCY (ONSET DATE = UN UNK 2016)';
   length newstr $ 25;
   newstr = strip(scan(str,2,'.('));
run;&lt;/PRE&gt;
&lt;P&gt;The SCAN function can be provided explicit delimiters, in this case the period and left parentheses. Since the value you want would have a leading blank I add strip to remove that.&lt;/P&gt;
&lt;P&gt;Without knowing other possible values needed it is a good idea to set a length for the new variable to hold the longest expected length. Otherwise your length would be set from the first record and might not be as long as needed for other records.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541513#M149518</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-08T18:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541517#M149520</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; Very clever indeed. But honestly in a prod environment and that too for a low/intermediate users can be a hard learning curve. Well even for experienced, the &lt;U&gt;maintenance can be daunting&lt;/U&gt; unless the genius&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; lives forever to support them.&amp;nbsp; Kudos!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541517#M149520</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-08T18:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541518#M149521</link>
      <description>&lt;P&gt;Also if you may and have time, for the sake of others, a note on how scan treats various combination of delimiters with/without modifiers will help. My $0.02 cents&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541518#M149521</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-08T18:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text string between two delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541535#M149528</link>
      <description>I am a sas lover and trying to improove myself.&lt;BR /&gt;I really thanks to all of you. I learn new things from every replys, different ways...thanks again.</description>
      <pubDate>Fri, 08 Mar 2019 18:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Capture-text-string-between-two-delimiters/m-p/541535#M149528</guid>
      <dc:creator>Yavuz</dc:creator>
      <dc:date>2019-03-08T18:59:55Z</dc:date>
    </item>
  </channel>
</rss>

