<?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 Date / Time Formatting Issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/313734#M68216</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with DATE in SAS.&lt;/P&gt;&lt;P&gt;I have DATE in my table&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5972i404EBEC44F22C4C6/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Przechwytywanie.PNG" title="Przechwytywanie.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i change the format of this date (&lt;SPAN&gt;Format AUGDT DATE9.;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;I get only ****** (9999-12-31)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is all about?&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 10:38:17 GMT</pubDate>
    <dc:creator>Arsene83</dc:creator>
    <dc:date>2016-11-23T10:38:17Z</dc:date>
    <item>
      <title>Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/313734#M68216</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with DATE in SAS.&lt;/P&gt;&lt;P&gt;I have DATE in my table&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5972i404EBEC44F22C4C6/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Przechwytywanie.PNG" title="Przechwytywanie.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i change the format of this date (&lt;SPAN&gt;Format AUGDT DATE9.;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;I get only ****** (9999-12-31)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is all about?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/313734#M68216</guid>
      <dc:creator>Arsene83</dc:creator>
      <dc:date>2016-11-23T10:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/313738#M68219</link>
      <description>&lt;P&gt;Dates and times are stored a numbers from a certain time point. &amp;nbsp;AUGDT you give is a datetime variable. &amp;nbsp;Hence the number stored behind the scenes is a datetime amount from a certain time. &amp;nbsp;If you then try to format this larger number as a smaller date it is far outside the proper date number range hence you get *****.&lt;/P&gt;
&lt;P&gt;You need to split the date part of the datetime out, then format that, eg;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  mydate=datepart(augdt);
  format mydate date9.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this coe for instance, then look at the values in show_actual_value variables, you can see the difference:&lt;/P&gt;
&lt;PRE&gt;data test;
  augdt="01JAN2016 14:15"dt;
  show_actual_value_dt=augdt;
  d9fmt=datepart(augdt);
  show_actual_value_d=d9fmt;
  format augdt datetime. d9fmt date9.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/313738#M68219</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-23T10:55:50Z</dc:date>
    </item>
  </channel>
</rss>

