<?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 Convert SAS date to MS standard date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64177#M18244</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to convert SAS date (08JUN2009) to microsoft standard date the method I have used is as follows - &lt;BR /&gt;
&lt;BR /&gt;
PolstDt+21916 as SysProdDte  label='SysProdDte' format=8.,&lt;BR /&gt;
&lt;BR /&gt;
Any help appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Thu, 13 Aug 2009 11:59:48 GMT</pubDate>
    <dc:creator>dotman</dc:creator>
    <dc:date>2009-08-13T11:59:48Z</dc:date>
    <item>
      <title>Convert SAS date to MS standard date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64177#M18244</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to convert SAS date (08JUN2009) to microsoft standard date the method I have used is as follows - &lt;BR /&gt;
&lt;BR /&gt;
PolstDt+21916 as SysProdDte  label='SysProdDte' format=8.,&lt;BR /&gt;
&lt;BR /&gt;
Any help appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Thu, 13 Aug 2009 11:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64177#M18244</guid>
      <dc:creator>dotman</dc:creator>
      <dc:date>2009-08-13T11:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SAS date to MS standard date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64178#M18245</link>
      <description>My understanding is that ms needs a datetime field. This is what I've used.  &lt;BR /&gt;
&lt;BR /&gt;
In your case, I think you will have to add time 00:00:00 to the sas date and then go through the steps below.  Hopefully this will get you started.       &lt;BR /&gt;
&lt;BR /&gt;
Asof=sasdate plus sastime as a SAS datetime value;**Build sas datetime value;&lt;BR /&gt;
      **Build microsoft date serial;&lt;BR /&gt;
AS_Of=(int(asof/86400) + 21916) + ((asof-(int(asof/86400)*86400))/86400);</description>
      <pubDate>Thu, 13 Aug 2009 12:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64178#M18245</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2009-08-13T12:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SAS date to MS standard date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64179#M18246</link>
      <description>You may want to entertain the question: what is it that you are trying to achieve - as in the final result?  Then consider this SAS DOC reference, with relevance to external date formats:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/61891/HTML/default/a003079774.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acpcref/61891/HTML/default/a003079774.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
So, if you have an alternate baseline where 0 represents some particular point in time (date or date/time), then my suggestion is that you decrement from SAS DATE (days since 1/1/1960) or DATETIME (seconds since 1/1/1960) back to your baseline DATE/DATETIME representation, using the quite-useful MDY and/or the DHMS functions -- let SAS do the calculations for you rather than attempting to handle the calculation, instead.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 13 Aug 2009 17:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-SAS-date-to-MS-standard-date/m-p/64179#M18246</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-08-13T17:55:08Z</dc:date>
    </item>
  </channel>
</rss>

