<?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: Substring a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Substring-a-string/m-p/900651#M355938</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    where=findw(x,'will',' ');
    name=substr(x,1,where-2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This method fails for someone who has the name "will" in their name, such as the famous political writer George F. Will or the famous actor Will Smith, unless we can depend on the fact that all names are properly capitalized in the data set. It also fails if will is capitalized as "Will", or if will does not exist in the string.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2023 12:00:41 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-10-30T12:00:41Z</dc:date>
    <item>
      <title>Substring a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substring-a-string/m-p/900647#M355936</link>
      <description>&lt;P&gt;Hi, researchers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to substring a person's name from a description.&lt;/P&gt;
&lt;P&gt;It seems to have a rule like XXX will become, XXX will step.&lt;/P&gt;
&lt;P&gt;Therefore, how do I substring&amp;nbsp;person's name&amp;nbsp;before will?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $50.;
cards;
A Barr Dolan will become
A Brooke Seawell will step
Aharon Schwartz will become
Maureen F Morrison will become
Matthew Bilunas will become
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Output Want&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Text&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;Name&lt;/P&gt;
&lt;P&gt;A Barr Dolan will become&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A Barr Dolan&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A Brooke Seawell will step&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A Brooke Seawell&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Aharon Schwartz will become&amp;nbsp; &amp;nbsp;Aharon Schwartz&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 11:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substring-a-string/m-p/900647#M355936</guid>
      <dc:creator>shawnchen0321</dc:creator>
      <dc:date>2023-10-30T11:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Substring a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substring-a-string/m-p/900651#M355938</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    where=findw(x,'will',' ');
    name=substr(x,1,where-2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This method fails for someone who has the name "will" in their name, such as the famous political writer George F. Will or the famous actor Will Smith, unless we can depend on the fact that all names are properly capitalized in the data set. It also fails if will is capitalized as "Will", or if will does not exist in the string.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 12:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substring-a-string/m-p/900651#M355938</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-30T12:00:41Z</dc:date>
    </item>
  </channel>
</rss>

