<?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 derive first name ,lastname,dob from a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482291#M124892</link>
    <description>&lt;P&gt;You've already have good advice on getting dob.&amp;nbsp; Here's a simplication for first and last names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  fname=scan(name,1,'0123456789');
  lname=scan(name,-1,'0123456789');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "-1" argument for scan in the lname assignment says to count backwards from the right-most word.&amp;nbsp; This mean you don't have to worry about how many digits are in the dob value.&lt;/P&gt;</description>
    <pubDate>Sun, 29 Jul 2018 15:21:40 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2018-07-29T15:21:40Z</dc:date>
    <item>
      <title>how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482253#M124868</link>
      <description>&lt;P&gt;data s;&lt;BR /&gt;name='ram28062018kumar' ;&lt;BR /&gt;output ;&lt;BR /&gt;name='venkat15072018sharma' ;&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*this my code to extract first name ,last name,dob.&lt;/P&gt;&lt;P&gt;is there any other coding?*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data s1 ;&lt;BR /&gt;set s ;&lt;BR /&gt;finame=substr(name,1,anydigit(name)-1) ;&lt;BR /&gt;laname=reverse(substr(reverse(name),1,anydigit(reverse(name))-1));&lt;BR /&gt;dob1=compress(name,' ','kd') ;&lt;BR /&gt;dob= input(compress(substr(dob1,1,2)||'-'||substr(dob1,3,2)||'-'||substr(dob1,5,4)),ddmmyy10.);&lt;BR /&gt;format dob ddmmyyd10. ;&lt;BR /&gt;drop dob1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 08:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482253#M124868</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-07-29T08:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482254#M124869</link>
      <description>&lt;P&gt;What do you mean by &lt;STRONG&gt;"&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;is there any other coding?"&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your code does what it is suppose to, it seems?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 08:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482254#M124869</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-29T08:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482255#M124870</link>
      <description>i mean any other short way</description>
      <pubDate>Sun, 29 Jul 2018 08:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482255#M124870</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-07-29T08:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482261#M124874</link>
      <description>&lt;P&gt;You don't need to insert hyphens in the date string; just use the ddmmyy8. informat.&lt;/P&gt;
&lt;P&gt;Otherwise, your code looks fine.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 10:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482261#M124874</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-29T10:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482280#M124887</link>
      <description>&lt;P&gt;You don't really need to create dob1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dob = input(compress(name,,'kd'), ddmmyy8.);&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 13:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482280#M124887</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-29T13:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to derive first name ,lastname,dob from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482291#M124892</link>
      <description>&lt;P&gt;You've already have good advice on getting dob.&amp;nbsp; Here's a simplication for first and last names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  fname=scan(name,1,'0123456789');
  lname=scan(name,-1,'0123456789');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "-1" argument for scan in the lname assignment says to count backwards from the right-most word.&amp;nbsp; This mean you don't have to worry about how many digits are in the dob value.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 15:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-derive-first-name-lastname-dob-from-a-string/m-p/482291#M124892</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-07-29T15:21:40Z</dc:date>
    </item>
  </channel>
</rss>

