<?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 Macro Wrong Date Display in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337248#M76569</link>
    <description>&lt;P&gt;I am writing the following code to Obtain DTM1 = 03JUN2013:09:15:00.&lt;/P&gt;
&lt;P&gt;But Instead it gives me the value of DTM1 =&amp;nbsp;&amp;nbsp;07JUL****:09:15:00.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure how is it converting 03062013 into 07JULY**** .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plz. Help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro DTX(d);
Data FA.ACC_NBNSFinal; Set FA.ACC_NBNSFinal_&amp;amp;d;
OrdDate = &amp;amp;d; /*'&amp;amp;d'd Gives Error*/
Format OrdDate Date9.;
DTM1=dhms(OrdDate,0,0,T);
format DTM1 datetime22.;
Drop OrdDate;
run;
%Mend;
%DTX(03062013);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ritesh&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 06:35:40 GMT</pubDate>
    <dc:creator>rkdubey84</dc:creator>
    <dc:date>2017-03-02T06:35:40Z</dc:date>
    <item>
      <title>Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337248#M76569</link>
      <description>&lt;P&gt;I am writing the following code to Obtain DTM1 = 03JUN2013:09:15:00.&lt;/P&gt;
&lt;P&gt;But Instead it gives me the value of DTM1 =&amp;nbsp;&amp;nbsp;07JUL****:09:15:00.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure how is it converting 03062013 into 07JULY**** .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plz. Help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro DTX(d);
Data FA.ACC_NBNSFinal; Set FA.ACC_NBNSFinal_&amp;amp;d;
OrdDate = &amp;amp;d; /*'&amp;amp;d'd Gives Error*/
Format OrdDate Date9.;
DTM1=dhms(OrdDate,0,0,T);
format DTM1 datetime22.;
Drop OrdDate;
run;
%Mend;
%DTX(03062013);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ritesh&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 06:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337248#M76569</guid>
      <dc:creator>rkdubey84</dc:creator>
      <dc:date>2017-03-02T06:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337250#M76570</link>
      <description>&lt;P&gt;SAS is seeing it as a number, specifically the number of days from Jan 1, 1960.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First convert it to a SAS date or pass as a date literal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%dtx('03Jun2016'd);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or convert it to a date,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ordDafe = input(put(&amp;amp;d, 8.), ddmmyy8.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337250#M76570</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-02T07:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337255#M76574</link>
      <description>OrdDate = input(put(&amp;amp;d, 8.), ddmmyy8.);&lt;BR /&gt;&lt;BR /&gt;Worked the wonders for me.&lt;BR /&gt;&lt;BR /&gt;Thanks a Ton Reeza &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337255#M76574</guid>
      <dc:creator>rkdubey84</dc:creator>
      <dc:date>2017-03-02T07:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337428#M76618</link>
      <description>&lt;P&gt;A hint for future diagnosis: the appearance of **** indicates that SAS can't correctly display the value with the chosen format. When you see this in a DATE related context it usually means that the date is past the year 9999. A brief example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   x = '15JAN10350'd;
   year = year(x);
   put x= best12. +1 'with date format'+1 x= date9. year=;
run;&lt;/PRE&gt;
&lt;P&gt;Until someone convinces SAS that we need to display more than 4 digit years none of the existing date/datetime formats will display years after 9999 correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 16:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337428#M76618</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-02T16:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337429#M76619</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Hahahaha... That's quite a proactive thinking for the near future. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 02 Mar 2017 16:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337429#M76619</guid>
      <dc:creator>rkdubey84</dc:creator>
      <dc:date>2017-03-02T16:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Wrong Date Display</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337492#M76641</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40842"&gt;@rkdubey84&lt;/a&gt; wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Hahahaha... That's quite a proactive thinking for the near future. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I was working on some data prior to the year 2000 and kept getting requests about whether the way I was handling data is SAS would be acceptable for Y2K issues. After about a dozen of those I did some tests with SAS date values to find the valid ranges and noted that they end 31 Dec 20000 for date literals: x='31DEC20000'd;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The questions stopped when I emphasized that the dates were good for most of the next 18,000 years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 18:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Wrong-Date-Display/m-p/337492#M76641</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-02T18:44:51Z</dc:date>
    </item>
  </channel>
</rss>

