<?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 Separate First name and Middle name and Last name in SAS ??? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628124#M185545</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Here First name="Richard" and Last name="Rose"


if another records have two separate names in string you will take first name,Middle name1,Middle name2,Last name......No issues&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 07:40:45 GMT</pubDate>
    <dc:creator>Mohan_Reddy</dc:creator>
    <dc:date>2020-02-28T07:40:45Z</dc:date>
    <item>
      <title>How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628109#M185538</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;I have data set like below...

data stansys;
infile datalines;
input id name&amp;amp;$24. sal;
datalines;
101 Richard Rose           5000
102 Yao Chen Hoo           6000
103 Asha Garg Bette Long   7000
104 Jason Blue             9000
105 Susan Robert Stewart   8000
;
run;


Through this dataset i want output dataset with seperating as First name and Middle name and last name...

So please give a programme for this !!!&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 06:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628109#M185538</guid>
      <dc:creator>Mohan_Reddy</dc:creator>
      <dc:date>2020-02-28T06:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628117#M185542</link>
      <description>&lt;P&gt;In a name like "Asha Garg Bette Long", what do you want the first, middle and last name to be?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628117#M185542</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-28T07:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628120#M185543</link>
      <description>&lt;P&gt;Taking the first row of your data, both "Richard" and "Rose" could be first names. So please define which words are first name, middle name and last name.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628120#M185543</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-02-28T07:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628122#M185544</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"Asha Garg Bette Long" through this&amp;nbsp;&lt;/SPAN&gt;You will take Middle name1="Garg" and Middle name2="Bette Like no issues.....&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628122#M185544</guid>
      <dc:creator>Mohan_Reddy</dc:creator>
      <dc:date>2020-02-28T07:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628124#M185545</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Here First name="Richard" and Last name="Rose"


if another records have two separate names in string you will take first name,Middle name1,Middle name2,Last name......No issues&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628124#M185545</guid>
      <dc:creator>Mohan_Reddy</dc:creator>
      <dc:date>2020-02-28T07:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628128#M185548</link>
      <description>In First row First Name ="Richard" and Last Name="Rose"...&lt;BR /&gt;&lt;BR /&gt;In 2 and 3 and 5 Rows only you will Take First Name,Middle Name1,Middle Name2,Last Name like that i want output.....</description>
      <pubDate>Fri, 28 Feb 2020 07:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628128#M185548</guid>
      <dc:creator>Mohan_Reddy</dc:creator>
      <dc:date>2020-02-28T07:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628130#M185550</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313738"&gt;@Mohan_Reddy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Here First name="Richard" and Last name="Rose"


if another records have two separate names in string you will take first name,Middle name1,Middle name2,Last name......No issues&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And how many middle names do you expect in your data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also like to point you to &lt;A href="https://communities.sas.com/t5/New-SAS-User/How-to-take-patient-name-and-split-into-first-name-and-last-name/td-p/581564/jump-to/first-unread-message" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/How-to-take-patient-name-and-split-into-first-name-and-last-name/td-p/581564/jump-to/first-unread-message&lt;/A&gt;, especially the message from PaigeMiller, showing that extracting name-parts is not that easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set stansys;
   length first middle1 middle2 last $ 40;
   array parts[*] first middle1 middle2 last;

   do i = 1 to countw(name);
      if i = countw(name) and i &amp;lt; dim(parts) then do;
         parts[dim(parts)] = scan(name, i);
      end;
      else do;
         parts[i] = scan(name, i);
      end;
   end;

   drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want all middle-names in a single variable, i would use a regular expression.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628130#M185550</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-02-28T07:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: How To Separate First name and Middle name and Last name in SAS ???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628250#M185601</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313738"&gt;@Mohan_Reddy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In First row First Name ="Richard" and Last Name="Rose"...&lt;BR /&gt;&lt;BR /&gt;In 2 and 3 and 5 Rows only you will Take First Name,Middle Name1,Middle Name2,Last Name like that i want output.....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You may also have to consider names such as "de la Cruz" or "van Dyke" which are not unlikely last names if you have enough.&lt;/P&gt;
&lt;P&gt;Also do you have any titles such as Dr. Ms. Esq. in the data?&lt;/P&gt;
&lt;P&gt;Of things like Junior, "the third", II and similar ilk?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If at all practical I would go the source and see if they can create a separate clearly delimited file with each of first., last and middle names.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 15:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Separate-First-name-and-Middle-name-and-Last-name-in-SAS/m-p/628250#M185601</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-28T15:54:02Z</dc:date>
    </item>
  </channel>
</rss>

