<?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: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598594#M16319</link>
    <description>&lt;P&gt;If you've got the SAS Data Quality Server / DataFlux licensed then tokenizing a name string would be a "school book" example.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/dqclref/70016/HTML/default/viewer.htm#p0p4cunbfsorb6n1msv5bga88wdh.htm" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/cdl/en/dqclref/70016/HTML/default/viewer.htm#p0p4cunbfsorb6n1msv5bga88wdh.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 03:37:45 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-10-23T03:37:45Z</dc:date>
    <item>
      <title>r</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598569#M16311</link>
      <description />
      <pubDate>Wed, 01 Jul 2020 12:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598569#M16311</guid>
      <dc:creator>Anmolkhandelwal</dc:creator>
      <dc:date>2020-07-01T12:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598570#M16312</link>
      <description>&lt;P&gt;The best way to do this is to import the names separately. That is you manually identify the separate name components and line the data up starting in a particular column. Then your INPUT statement would look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @1 fname $20. @22 mname $20. @44 lname $20.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 01:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598570#M16312</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-10-23T01:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598572#M16314</link>
      <description>&lt;P&gt;1. COUNTW() to count the number of words in the string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If number of words is 2, then do the first and last only&lt;/P&gt;
&lt;P&gt;3. If number of words is &amp;gt;2, then get the first and last as the first/last and the others as middle.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SCAN() will allow you to retrieve the correct parts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will not be correct of course. Some names have 2 parts to the first or last component but there's no way for me to know which is which.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code doesn't run correctly, please ensure you test it before posting to ensure it reads your data correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 01:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598572#M16314</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-23T01:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598575#M16315</link>
      <description>&lt;P&gt;unless the count of words is &amp;gt; 3, then you need to start building some rules around what is excitable and not excitable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="color: #444444; font-family: Arial,Helvetica,Sans-Serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;
&lt;DIV class="rwrl rwrl_small rwrl_padref" style="font-family: &amp;amp;quot; segoe ui&amp;amp;quot;,arial,helvetica,sans-serif; font-size: 16px; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: 22px; padding-bottom: 15px;"&gt;Longest names – People with long names. &lt;STRONG style="font-weight: bold;"&gt;Nicholas Unless-Jesus-Christ-Had-Died-For-Thee-Thou-Hadst-Been-Damned Barebone&lt;/STRONG&gt; (short version: Nicholas Barbon) — an English economist, physician and financial speculator Anna Bertha Cecilia Diana Emily Fanny Gertrude Hypatia Inez Jane Kate Louise Maud Nora Ophelia Prudence Quince Rebecca Sarah Teresa &lt;U style="text-decoration: none;"&gt;Ulysis&lt;/U&gt;...&lt;/DIV&gt;
&lt;DIV class="rwrl_cred b_footnote" style="color: #767676; font-family: Arial,Helvetica,Sans-Serif; font-size: 13px; line-height: 16px; padding-bottom: 0px;"&gt;
&lt;DIV&gt;Reference: &lt;A style="color: #001ba0; font-size: inherit; text-decoration: none; touch-action: manipulation;" href="http://www.cuteandweird.com/2009/09/12/longest-names-people-with-long-names/" target="_blank"&gt;www.cuteandweird.com/2009/09/12/longest-names-people-with-long-…&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="df_rq" style="color: #444444; font-family: Arial,Helvetica,Sans-Serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 15px 0px 15px 0px;"&gt;&lt;A style="color: #001ba0; text-decoration: none; touch-action: manipulation;" href="https://www.bing.com/search?q=What%20are%20some%20long%20people%20names%3F" target="_blank"&gt;S&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Oct 2019 01:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598575#M16315</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-10-23T01:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598584#M16317</link>
      <description>lol. excitable?&lt;BR /&gt;OP, once you fix the data I'll try and post some code.</description>
      <pubDate>Wed, 23 Oct 2019 02:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598584#M16317</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-23T02:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598594#M16319</link>
      <description>&lt;P&gt;If you've got the SAS Data Quality Server / DataFlux licensed then tokenizing a name string would be a "school book" example.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/dqclref/70016/HTML/default/viewer.htm#p0p4cunbfsorb6n1msv5bga88wdh.htm" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/cdl/en/dqclref/70016/HTML/default/viewer.htm#p0p4cunbfsorb6n1msv5bga88wdh.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 03:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598594#M16319</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-23T03:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598595#M16320</link>
      <description>&lt;P&gt;Updated the input statement.&lt;/P&gt;&lt;P&gt;data names;&lt;BR /&gt;infile datalines;&lt;BR /&gt;input name $30.;&lt;/P&gt;&lt;P&gt;datalines;&lt;BR /&gt;arun krishna&lt;BR /&gt;gopal rao&lt;BR /&gt;venu vardhan reddy&lt;BR /&gt;rames krishna rao sunkara&lt;BR /&gt;kiran&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 03:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598595#M16320</guid>
      <dc:creator>Anmolkhandelwal</dc:creator>
      <dc:date>2019-10-23T03:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598600#M16321</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data names;
infile datalines;
input name $30.;

nwords = countw(name);
first_name = scan(name, 1);
if nwords &amp;gt;1 then last_name = scan(name, -1);
length middle_name $30.;
do i=2 to nwords-1;
middle_name = catx(" ", trim(middle_name), scan(name, i));
end;

datalines;
arun krishna
gopal rao
venu vardhan reddy
rames krishna rao sunkara
kiran
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 04:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598600#M16321</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-23T04:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598668#M16340</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data names;
infile datalines;
input name $30.;
datalines;
arun krishna
gopal rao
venu vardhan reddy
rames krishna rao sunkara
kiran
;
run;
data want;
 set names;
 call scan(name,1,p1,l1,' ');
 call scan(name,-1,p2,l2,' ');
first=scan(name,1,' ');
if p2&amp;gt;p1 then last=scan(name,-1,' ');
if p2&amp;gt;p1+l1+1 then middle=substr(name,p1+l1,p2-p1-l1);
drop p1 p2 l1 l2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 11:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598668#M16340</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-10-23T11:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to split my data into firstname,middlename and lastname. New to sas,not getting an approa</title>
      <link>https://communities.sas.com/t5/New-SAS-User/r/m-p/598736#M16352</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269825"&gt;@Anmolkhandelwal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;I have data something like below,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data names;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;infile datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input name $;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arun Krishna&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; which is first name, which is middle, which is last?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gopal rao&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;venu vardhan reddy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rames krishna rao sunkara&amp;nbsp; &amp;lt; which is first name, which is middle, which is last&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kiran&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt; which is first name, which is middle, which is last &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to 3 more variables like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;first name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;middle name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Last name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the variable does not have the middle name or last name then it should be blank please can you tell me the how to solve that particular problem&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If there are not exactly 3 names given then you need to provide rules as to how to treat 1, 2 or more name elements.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 14:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/r/m-p/598736#M16352</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-23T14:57:32Z</dc:date>
    </item>
  </channel>
</rss>

