<?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 How to parse strange formatted date in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-parse-strange-formatted-date/m-p/790392#M32477</link>
    <description>&lt;P&gt;The data I am working with has strangely formatted birthdates. For example:&lt;/P&gt;&lt;PRE&gt;29SEP86:00:00:00
26MAR81:00:00:00
01DEC45:00:00:00&lt;/PRE&gt;&lt;P&gt;Their birth dates then get plugged into the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;intck("year", birthday, TODAY())&lt;/PRE&gt;&lt;P&gt;function to find a persons current's age.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I parse the above numbers into correct SAS date-time numbers?&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jan 2022 05:22:04 GMT</pubDate>
    <dc:creator>heyyou1</dc:creator>
    <dc:date>2022-01-16T05:22:04Z</dc:date>
    <item>
      <title>How to parse strange formatted date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-parse-strange-formatted-date/m-p/790392#M32477</link>
      <description>&lt;P&gt;The data I am working with has strangely formatted birthdates. For example:&lt;/P&gt;&lt;PRE&gt;29SEP86:00:00:00
26MAR81:00:00:00
01DEC45:00:00:00&lt;/PRE&gt;&lt;P&gt;Their birth dates then get plugged into the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;intck("year", birthday, TODAY())&lt;/PRE&gt;&lt;P&gt;function to find a persons current's age.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I parse the above numbers into correct SAS date-time numbers?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 05:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-parse-strange-formatted-date/m-p/790392#M32477</guid>
      <dc:creator>heyyou1</dc:creator>
      <dc:date>2022-01-16T05:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse strange formatted date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-parse-strange-formatted-date/m-p/790396#M32478</link>
      <description>&lt;P&gt;Is that value a character or numeric? It may help to show us the results of Proc contents for that data set if you are not sure.&lt;/P&gt;
&lt;P&gt;If the value is character you can read it with a DATE7 informat:&lt;/P&gt;
&lt;PRE&gt;data example;
   x="29SEP86:00:00:00";
   datex = input(x,date7.);
   format datex date9.;
run;&lt;/PRE&gt;
&lt;P&gt;If the value is numeric then it should bea datetime value and you could get the just the date with the DATEPART function:&lt;/P&gt;
&lt;PRE&gt;data example;
   x="29SEP86:00:00:00"dt;
   datex = datepart(x);
   format x datetime16. datex date9.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is one of the things I typically blame on poor database programmers using some default that treats dates as date time values. If all of the time components are the same, ie 00:00:00 then the is no meaningful time to deal with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/406768"&gt;@heyyou1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The data I am working with has strangely formatted birthdates. For example:&lt;/P&gt;
&lt;PRE&gt;29SEP86:00:00:00
26MAR81:00:00:00
01DEC45:00:00:00&lt;/PRE&gt;
&lt;P&gt;Their birth dates then get plugged into the&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;intck("year", birthday, TODAY())&lt;/PRE&gt;
&lt;P&gt;function to find a persons current's age.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I parse the above numbers into correct SAS date-time numbers?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 06:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-parse-strange-formatted-date/m-p/790396#M32478</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-16T06:21:52Z</dc:date>
    </item>
  </channel>
</rss>

