<?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 convert name from first/last format to first initial and last name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705076#M216207</link>
    <description>&lt;P&gt;How about&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ReversedNames;
   input name $32.;
   datalines;
Sandy Chint
Kathy Kumarxy
Bobby Smith
Jason McDonald
Annie Avor
Thomas P Magliu
Joan Smith Korcos
;
run;

data want;
   set ReversedNames;
   newname = cat(char(name, 1), '. ', scan(name, -1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Dec 2020 14:49:16 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-12-10T14:49:16Z</dc:date>
    <item>
      <title>How to convert name from first/last format to first initial and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705074#M216205</link>
      <description>&lt;P&gt;Hi, I have names in my table that have the first and last name format. I need to convert the format to first initial follow by dot then last name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, Sandy Chint would be S.Chint, Kathy Kumarxy would be K.Kumarxy, and Thomas P Magliu would be T.Magliu&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;These names have first and last name format, as well as middle name/initial between first and last name. How to do this in prxchange or is there a better way to do it? Below is some examples. Thanks.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ReversedNames;
   input name $32.;
   datalines;
Sandy Chint
Kathy Kumarxy
Bobby Smith
Jason McDonald
Annie Avor
Thomas P Magliu
Joan Smith Korcos
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705074#M216205</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2020-12-10T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert name from first/last format to first initial and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705076#M216207</link>
      <description>&lt;P&gt;How about&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ReversedNames;
   input name $32.;
   datalines;
Sandy Chint
Kathy Kumarxy
Bobby Smith
Jason McDonald
Annie Avor
Thomas P Magliu
Joan Smith Korcos
;
run;

data want;
   set ReversedNames;
   newname = cat(char(name, 1), '. ', scan(name, -1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705076#M216207</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-10T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert name from first/last format to first initial and last name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705077#M216208</link>
      <description>&lt;P&gt;I prefer the common string functions for this rather simple task:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set reversednames;
name = catx(".",substr(name,1,1),scan(name,-1));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89004"&gt;@LL5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I have names in my table that have the first and last name format. I need to convert the format to first initial follow by dot then last name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, Sandy Chint would be S.Chint, Kathy Kumarxy would be K.Kumarxy, and Thomas P Magliu would be T.Magliu&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;These names have first and last name format, as well as middle name/initial between first and last name. How to do this in prxchange or is there a better way to do it? Below is some examples. Thanks.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ReversedNames;
   input name $32.;
   datalines;
Sandy Chint
Kathy Kumarxy
Bobby Smith
Jason McDonald
Annie Avor
Thomas P Magliu
Joan Smith Korcos
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-name-from-first-last-format-to-first-initial-and/m-p/705077#M216208</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-10T14:50:41Z</dc:date>
    </item>
  </channel>
</rss>

