<?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: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530180#M144962</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;" it's easier to remember the parameters," sounds like invariably efficient mind. Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; pointed out "&lt;SPAN&gt;So PRX is still approximately 3X slower than doing it with the SCAN function." plus SQL processor makes it all the more time consuming. Jeez! what if we were to deal with 5 years transaction data as population for customer spends analysis for campaign targeting models. I can only imagine the size of the data would let us have lunch session and coffee session combines and process might still be running &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I learned something from OP, You, draycut and ofcourse Mr. Quantmiller &lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;I just use SCAN() because I find it's easier to remember the parameters, has nothing to do with efficiency in terms of computer, but efficiency in terms of typing and my time. I should really just sit down one day and learn them &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jan 2019 19:25:49 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-01-25T19:25:49Z</dc:date>
    <item>
      <title>Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530146#M144949</link>
      <description>&lt;P&gt;proc sql;&lt;BR /&gt;select Manager_Name, Employee_Name, Total_Sales format=COMMA10.2&lt;BR /&gt;from (select l.Employee_ID, sum(Total_Retail_Price) as Total_Sales, Employee_Name, Country&lt;BR /&gt;from orion.order_fact as l,&lt;BR /&gt;orion.employee_addresses as p&lt;BR /&gt;where l.Employee_ID=p.Employee_ID and year(Order_Date)=2011&lt;BR /&gt;Group by Country, l.Employee_ID, Employee_Name) as l,&lt;BR /&gt;(select l.Employee_ID, Manager_ID, Employee_Name as Manager_Name&lt;BR /&gt;from orion.employee_organization as l,&lt;BR /&gt;orion.employee_addresses as p&lt;BR /&gt;where l.Manager_ID=p.Employee_ID) as p&lt;BR /&gt;where l.Employee_ID=p.Employee_ID&lt;BR /&gt;Order by Country, Manager_Name, Total_Sales desc;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employee_Name is shown as Zhou, Tom, but I need it to change it to Tom Zhou&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530146#M144949</guid>
      <dc:creator>loubams3</dc:creator>
      <dc:date>2019-01-25T18:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530149#M144950</link>
      <description>&lt;P&gt;Classic use of the PRXCHANGE Function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I stole this example directly from the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0r8h2fa8djqf1n1cnenrvm573br.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n0sno4eung0r6qn1vcdbbpnx8zrx" target="_self"&gt;PRXCHANGE Documentation (Example 2)&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ReversedNames;
   input name &amp;amp; $32.;
   datalines;
Jones, Fred
Kavich, Kate
Turley, Ron
Dulix, Yolanda
Zhou, Tom
;
proc sql;
   create table names as
   select prxchange('s/(\w+), (\w+)/$2 $1/', -1, name) as name
   from ReversedNames;
quit;
proc print data=names;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530149#M144950</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-25T18:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530151#M144952</link>
      <description>&lt;P&gt;If the&amp;nbsp;data is well formatted you can easily use SCAN() as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;catx(" ", scan(employee_name, 2, ","), scan(employee_name, 1, ",")) as new_name&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530151#M144952</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T18:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530159#M144954</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; is brilliant to answer at lightning speed making me jealous while i was testing the same with&lt;STRONG&gt; 50 million&lt;/STRONG&gt; records on my machine&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the log difference. Kudos Reeza&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;361  proc sql;
362     create table names as
363     select prxchange('s/(\w+), (\w+)/$2 $1/', -1, name) as name
364     from ReversedNames;
NOTE: Table WORK.NAMES created, with 50000000 rows and 1 columns.

365  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1:39.26
      cpu time            33.20 seconds


366  data names;
367   set ReversedNames;
368   name=catx(', ',scan(name,-1),scan(name,1));
369   run;

NOTE: There were 50000000 observations read from the data set WORK.REVERSEDNAMES.
NOTE: The data set WORK.WANT has 50000000 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           10.46 seconds
      cpu time            8.90 seconds
&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp; mentioned PRX being very slow in another thread and the above is the proof. But Mark if you have a minute, do you know why so? Is there an implementation problem? I am just curious&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530159#M144954</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-25T19:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530162#M144955</link>
      <description>&lt;P&gt;Is it PRX that is slow, or is it doing this operation in SQL is the cause of the slowness? What happens if you try the PRX in a data step?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530162#M144955</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-25T19:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530166#M144956</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; &amp;nbsp;Like I always said, you are full of brains, much better&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;370  data names;
371   set ReversedNames;
372   name=prxchange('s/(\w+), (\w+)/$2 $1/', -1, name);
373   run;

NOTE: There were 50000000 observations read from the data set WORK.REVERSEDNAMES.
NOTE: The data set WORK.NAMES has 50000000 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           32.99 seconds
      cpu time            22.29 seconds
&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530166#M144956</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-25T19:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530167#M144957</link>
      <description>&lt;P&gt;Great presence of mind!!!!!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530167#M144957</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-25T19:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530169#M144958</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/162-30.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/162-30.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/178-30.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/178-30.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530169#M144958</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T19:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530176#M144959</link>
      <description>&lt;P&gt;So PRX is still approximately 3X slower than doing it with the SCAN function.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530176#M144959</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-25T19:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530177#M144960</link>
      <description>&lt;P&gt;Thank you. Looks interesting. Will take a serious look.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For those who work on&lt;EM&gt;&lt;STRONG&gt; large datasets on prod environments,&lt;/STRONG&gt;&lt;/EM&gt; dealing with humongous data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. SQL processor doesn't seem to compete well with a datastep&lt;/P&gt;
&lt;P&gt;2. PRX if not avoidable coz some manipulations are done best with PRX, otherwise stick to SAS functions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Disclaimer: Nonetheless,only extensive&amp;nbsp; testing with rich samples can only confirm&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530177#M144960</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-25T19:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530178#M144961</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;I just use SCAN() because I find it's easier to remember the parameters, has nothing to do with efficiency in terms of computer, but efficiency in terms of typing and my time. I should really just sit down one day and learn them &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530178#M144961</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T19:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530180#M144962</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;" it's easier to remember the parameters," sounds like invariably efficient mind. Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; pointed out "&lt;SPAN&gt;So PRX is still approximately 3X slower than doing it with the SCAN function." plus SQL processor makes it all the more time consuming. Jeez! what if we were to deal with 5 years transaction data as population for customer spends analysis for campaign targeting models. I can only imagine the size of the data would let us have lunch session and coffee session combines and process might still be running &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I learned something from OP, You, draycut and ofcourse Mr. Quantmiller &lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;I just use SCAN() because I find it's easier to remember the parameters, has nothing to do with efficiency in terms of computer, but efficiency in terms of typing and my time. I should really just sit down one day and learn them &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530180#M144962</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-25T19:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting an Employee_Name (Last Name, First Name) to (First Name Last Name)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530186#M144963</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;I can only imagine the size of the data would let us have lunch session and coffee session ...&amp;nbsp;&lt;/SPAN&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first company to ever allow its employees to have coffee breaks is located about one mile from here in Buffalo, NY. It is the Barcalo Manufacturing Company, now known as Barcalounger (because they also invented the first recliner, the Barcalounger).&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-an-Employee-Name-Last-Name-First-Name-to-First-Name/m-p/530186#M144963</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-25T19:43:09Z</dc:date>
    </item>
  </channel>
</rss>

