<?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: Function to extract substring between two delimiters that are the same in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524210#M142525</link>
    <description>&lt;P&gt;Thanks for the quick response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have included the entire length of the string which is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ATC|R|RESPIRATORY SYSTEM&lt;STRONG&gt;; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES;&lt;/STRONG&gt; ATC|R03A|ADRENERGICS, INHALANTS; ATC|R03AC|SELECTIVE BETA-2-ADRENORECEPTOR AGONISTS; PRODUCT|001395 01 001|SALBUTAMOL; PRODUCTSYNONYM|001395 01 002|VENTOLIN /00139501/;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2019 02:40:03 GMT</pubDate>
    <dc:creator>mglogan</dc:creator>
    <dc:date>2019-01-03T02:40:03Z</dc:date>
    <item>
      <title>Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524208#M142523</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to extract a medication class that is between two delimiters that are the same. In this case, it is a semi-colon (&lt;STRONG&gt;;&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;have &lt;/STRONG&gt;(oldvar)&lt;STRONG&gt;&amp;nbsp;=&lt;/STRONG&gt; ATC|R|RESPIRATORY SYSTEM&lt;STRONG&gt;;&lt;/STRONG&gt; &lt;STRONG&gt;ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES;&lt;/STRONG&gt; ATC|R03A|ADRENERGICS, INHALANTS; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;want &lt;/STRONG&gt;(newvar) =&amp;nbsp;&lt;STRONG&gt;ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you suggest an effective way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524208#M142523</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-03T02:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524209#M142524</link>
      <description>&lt;P&gt;do you mean this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
have=' ATC|R|RESPIRATORY SYSTEM; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES';
want=scan(have,-1,';','m');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or just this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data test;
have=' ATC|R|RESPIRATORY SYSTEM; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES';
want=scan(have,-1,';');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524209#M142524</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-03T02:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524210#M142525</link>
      <description>&lt;P&gt;Thanks for the quick response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have included the entire length of the string which is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ATC|R|RESPIRATORY SYSTEM&lt;STRONG&gt;; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES;&lt;/STRONG&gt; ATC|R03A|ADRENERGICS, INHALANTS; ATC|R03AC|SELECTIVE BETA-2-ADRENORECEPTOR AGONISTS; PRODUCT|001395 01 001|SALBUTAMOL; PRODUCTSYNONYM|001395 01 002|VENTOLIN /00139501/;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524210#M142525</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-03T02:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524211#M142526</link>
      <description>&lt;P&gt;is it always in 2nd position?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if yes, extract the 2nd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data test;
have='ATC|R|RESPIRATORY SYSTEM; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES; ATC|R03A|ADRENERGICS, INHALANTS; ATC|R03AC|SELECTIVE BETA-2-ADRENORECEPTOR AGONISTS; PRODUCT|001395 01 001|SALBUTAMOL; PRODUCTSYNONYM|001395 01 002|VENTOLIN /00139501/;';
want=strip(scan(have,2,';'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524211#M142526</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-03T02:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524212#M142527</link>
      <description>&lt;P&gt;It will always be between the first and second semi-colon.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 06:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524212#M142527</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-03T06:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524213#M142528</link>
      <description>&lt;P&gt;ok, i updated in my previous. check that out plz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
have='ATC|R|RESPIRATORY SYSTEM; ATC|R03|DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES; ATC|R03A|ADRENERGICS, INHALANTS; ATC|R03AC|SELECTIVE BETA-2-ADRENORECEPTOR AGONISTS; PRODUCT|001395 01 001|SALBUTAMOL; PRODUCTSYNONYM|001395 01 002|VENTOLIN /00139501/;';
want=strip(scan(have,2,';'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524213#M142528</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-03T02:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function to extract substring between two delimiters that are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524214#M142529</link>
      <description>&lt;P&gt;It worked. thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-extract-substring-between-two-delimiters-that-are/m-p/524214#M142529</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-03T02:49:44Z</dc:date>
    </item>
  </channel>
</rss>

