<?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 Converting numeric dates to SAS dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70860#M20405</link>
    <description>I have been exploring the best way to convert numeric dates in the form 19990125 (YYYYMMDD) to SAS date values.&lt;BR /&gt;
&lt;BR /&gt;
So far, I have come up with the following solution:&lt;BR /&gt;
For numeric dates in the form 20050101 (YYYYMMDD): input(put(TABLE.DATE_COL ,8.),YYMMDD10.)&lt;BR /&gt;
For numeric dates in the form 200501 (YYYYMM): input(put(TABLE.DATE_COL ,6.)||'01',YYMMDD10.) &lt;BR /&gt;
&lt;BR /&gt;
Does anyone know of a better/more efficient way of doing this?  Many dates from oracle or db2 come in this format and as often as SAS imports data from these dbms, I would think there is a better way.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
    <pubDate>Fri, 11 Sep 2009 16:55:24 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-09-11T16:55:24Z</dc:date>
    <item>
      <title>Converting numeric dates to SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70860#M20405</link>
      <description>I have been exploring the best way to convert numeric dates in the form 19990125 (YYYYMMDD) to SAS date values.&lt;BR /&gt;
&lt;BR /&gt;
So far, I have come up with the following solution:&lt;BR /&gt;
For numeric dates in the form 20050101 (YYYYMMDD): input(put(TABLE.DATE_COL ,8.),YYMMDD10.)&lt;BR /&gt;
For numeric dates in the form 200501 (YYYYMM): input(put(TABLE.DATE_COL ,6.)||'01',YYMMDD10.) &lt;BR /&gt;
&lt;BR /&gt;
Does anyone know of a better/more efficient way of doing this?  Many dates from oracle or db2 come in this format and as often as SAS imports data from these dbms, I would think there is a better way.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Fri, 11 Sep 2009 16:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70860#M20405</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-11T16:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting numeric dates to SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70861#M20406</link>
      <description>Recommend searching the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website - here is a useful Google advanced search argument which yielded some DOC and technical/conference reference matches:&lt;BR /&gt;
&lt;BR /&gt;
converting oracle dates site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 11 Sep 2009 17:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70861#M20406</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-11T17:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting numeric dates to SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70862#M20407</link>
      <description>I believe SAS does a pretty good job in converting dates from a DBMS.&lt;BR /&gt;
But if the dates in the DMBS are stored as characters - well: then you store them as well as characters in SAS or you tell SAS how to convert these characters.&lt;BR /&gt;
&lt;BR /&gt;
Only because there are digits in this character columns doesn't make it numeric (anyway in most DBMS there are special types for dates).&lt;BR /&gt;
&lt;BR /&gt;
But what about this:&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  chardate='20050912';&lt;BR /&gt;
  numdate=input(chardate,yymmdd8.);&lt;BR /&gt;
  put numdate yymmdds10.;&lt;BR /&gt;
&lt;BR /&gt;
  chardate='200509';&lt;BR /&gt;
  numdate=input(chardate,yymmn6.);&lt;BR /&gt;
  put numdate yymms7.;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Sat, 12 Sep 2009 14:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-numeric-dates-to-SAS-dates/m-p/70862#M20407</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-09-12T14:11:12Z</dc:date>
    </item>
  </channel>
</rss>

