<?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: Variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671287#M23372</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338673"&gt;@honeyblue&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a variable name with value NaveenKumar, HarishChandra, SivaKumar&lt;/P&gt;
&lt;P&gt;But I want to separate as firstname and last name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex Firstname ------------Naveen lastname&amp;nbsp; &amp;nbsp;----Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you have one variable containing the complete string or is the comma meant to separate observations?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 05:07:19 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-07-22T05:07:19Z</dc:date>
    <item>
      <title>Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671277#M23370</link>
      <description>&lt;P&gt;I have a variable name with value NaveenKumar, HarishChandra, SivaKumar&lt;/P&gt;&lt;P&gt;But I want to separate as firstname and last name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex Firstname ------------Naveen lastname&amp;nbsp; &amp;nbsp;----Kumar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671277#M23370</guid>
      <dc:creator>honeyblue</dc:creator>
      <dc:date>2020-07-22T03:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671287#M23372</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338673"&gt;@honeyblue&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a variable name with value NaveenKumar, HarishChandra, SivaKumar&lt;/P&gt;
&lt;P&gt;But I want to separate as firstname and last name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex Firstname ------------Naveen lastname&amp;nbsp; &amp;nbsp;----Kumar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you have one variable containing the complete string or is the comma meant to separate observations?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 05:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671287#M23372</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-22T05:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671288#M23373</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   length name $ 40;
   input name;
   datalines;
NaveenKumar
HarishChandra
SivaKumar
;
run;

data want;
   set have;
   
   length firstname lastname $ 30;
   retain rx;
   drop rx;
   
   if _n_ = 1 then do;
      rx = prxparse('/([A-Z][a-z]+)([A-Z][a-z]+)/');
   end;
   
   if prxmatch(rx, name) then do;
      firstname = prxposn(rx, 1, name);
      lastname = prxposn(rx, 2, name);
   end;
   else do;
      put 'ERROR: Unable to extract firstname/lastname from data';
      put _all_;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 05:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable/m-p/671288#M23373</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-22T05:14:04Z</dc:date>
    </item>
  </channel>
</rss>

