<?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 Substring Variable from one word to another in middle of string ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/460050#M116905</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $80.;
s=prxmatch('/utilisateur|user/',x);
e=prxmatch('/du groupe|in group/',x);
temp=substr(x,s,e-s);
want=substr(temp,findc(temp,' '));
drop s e temp;
cards;
Attribué à utilisateur Ali Khan du groupe Quebec Property 2
Assigned to user Marie-Helene Adams in group CAS
Assigned to user Jeff Mills in group National Personal Lines Auto 3
Assigned to user Wendy Taylor-Wu in group NRU Auto/Casualty
Attribué à utilisateur Laurence A. Weinstein du groupe Quebec 1
;
run;

proc print noobs;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 04 May 2018 14:23:01 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-05-04T14:23:01Z</dc:date>
    <item>
      <title>How to Substring Variable from one word to another in middle of string ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459724#M116793</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to subset string between words 'user/utilisateur' and 'du/in' . Considering English and French both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have variable 'Description' with following values:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DECSRIPTION:&lt;/P&gt;&lt;P&gt;Attribué à utilisateur Ali Khan du groupe Quebec Property 2&lt;/P&gt;&lt;P&gt;Assigned to user Marie-Helene Adams in group CAS&lt;/P&gt;&lt;P&gt;Assigned to user Jeff Mills in group National Personal Lines Auto 3&lt;/P&gt;&lt;P&gt;Assigned to user Wendy Taylor-Wu in group NRU Auto/Casualty&lt;/P&gt;&lt;P&gt;Attribué à utilisateur Laurence A. Weinstein du groupe Quebec 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want - variable Name with value:&lt;/P&gt;&lt;P&gt;Ali Khan&lt;/P&gt;&lt;P&gt;Marie-Helene Adams&lt;/P&gt;&lt;P&gt;Jeff Mills&lt;/P&gt;&lt;P&gt;Wendy Taylor-Wu&lt;/P&gt;&lt;P&gt;Laurence A. Weinstein&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 16:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459724#M116793</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-05-03T16:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Substring Variable from one word to another in middle of string ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459739#M116795</link>
      <description>&lt;P&gt;Here is one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want (drop=start end);
  set have;
   if findw(DECSRIPTION,'user') then start=
    findw(DECSRIPTION,'user') +5;
   else start=findw(DECSRIPTION,'utilisateur') +12;
  end=max(findw(DECSRIPTION,'du'),findw(DECSRIPTION,'in')) -1;
  name=substr(DECSRIPTION,start,end-start);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 16:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459739#M116795</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-05-03T16:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to Substring Variable from one word to another in middle of string ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459740#M116796</link>
      <description>&lt;P&gt;If all your data is this structured, use INDEXW to find the location of the words and that will give you the positions of the string you want to extract. Make sure to either upper case or lower case the comparisons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 16:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/459740#M116796</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-03T16:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Substring Variable from one word to another in middle of string ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/460050#M116905</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $80.;
s=prxmatch('/utilisateur|user/',x);
e=prxmatch('/du groupe|in group/',x);
temp=substr(x,s,e-s);
want=substr(temp,findc(temp,' '));
drop s e temp;
cards;
Attribué à utilisateur Ali Khan du groupe Quebec Property 2
Assigned to user Marie-Helene Adams in group CAS
Assigned to user Jeff Mills in group National Personal Lines Auto 3
Assigned to user Wendy Taylor-Wu in group NRU Auto/Casualty
Attribué à utilisateur Laurence A. Weinstein du groupe Quebec 1
;
run;

proc print noobs;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 May 2018 14:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Substring-Variable-from-one-word-to-another-in-middle-of/m-p/460050#M116905</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-05-04T14:23:01Z</dc:date>
    </item>
  </channel>
</rss>

