<?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 get rid of middle initial in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824547#M41145</link>
    <description>&lt;P&gt;I just want to put an emphasis on the question asked by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;What about multi-word surnames? If you have any, trying to figure out if a word is indeed a middle name or part of a surname is tricky.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So please post some data and show the expected result.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2022 05:01:51 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-07-21T05:01:51Z</dc:date>
    <item>
      <title>how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824522#M41142</link>
      <description>&lt;P&gt;I have a field that has full name including middle initial and possibly full middle name.&amp;nbsp; How do i remove that from the field?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table one as 
select 
distinct strip(a.name) as name_strip,
dob
from two a
inner join three b&lt;BR /&gt;order by name_strip;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 23:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824522#M41142</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-07-20T23:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824527#M41143</link>
      <description>&lt;P&gt;What does your data look like? You need to provide some example data otherwise we will just be guessing. What about multi-word surnames? If you have any, trying to figure out if a word is indeed a middle name or part of a surname is tricky.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 00:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824527#M41143</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-07-21T00:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824528#M41144</link>
      <description>&lt;P&gt;I might try something along the lines of:&lt;/P&gt;
&lt;PRE&gt;case 
   when countw(a.name)&amp;lt;3 then strip(a.name)
   when countw(a.name)=3 then catx(' ',scan(a.name,1),scan(a.name,3))
   when countw(a.name)=4 then catx(' ',scan(a.name,1),scan(a.name,3),scan(a.name,4))
end as name_strip&lt;/PRE&gt;
&lt;P&gt;The count for 3 and 4 a because of names that are compounds like "Le Blanc" "Van something" or such.&lt;/P&gt;
&lt;P&gt;If you have some of the long names from some enthic groups that may not be enough.&lt;/P&gt;
&lt;P&gt;If you have not seen Countw before it counts words, which are just about anything separated by spaces, commas, periods and couple of other characters. Scan uses the same delimiter characters to grab the numbered "word". Catx combines the results with the characters of the first parameter separating the bits. Each of the bits would have any leading or trailing blanks removed before inserting that parameter.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 00:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824528#M41144</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-07-21T00:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824547#M41145</link>
      <description>&lt;P&gt;I just want to put an emphasis on the question asked by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;What about multi-word surnames? If you have any, trying to figure out if a word is indeed a middle name or part of a surname is tricky.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So please post some data and show the expected result.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 05:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824547#M41145</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-07-21T05:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824548#M41146</link>
      <description>&lt;P&gt;ex: smith, John R&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to match names from a database&amp;nbsp; to a file i have with the names in it as well to see what matches i can get from the database&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 05:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824548#M41146</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-07-21T05:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to get rid of middle initial</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824769#M41149</link>
      <description>&lt;P&gt;If surnames are always first and followed by a comma then finding name components is relatively easy:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  name = 'smith, John R';
  surname = scan(name, 1, ',');
  first_name = scan(substr(name, find(name, ',') +1), 1);
  second_name = scan(substr(name, find(name, ',') +1), 2);
  name_new = catx(' ', first_name, surname); 
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 20:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-rid-of-middle-initial/m-p/824769#M41149</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-07-21T20:06:05Z</dc:date>
    </item>
  </channel>
</rss>

