<?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 SAS date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492768#M129554</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have converted a character variable to sas date&amp;nbsp;for calculation.&lt;/P&gt;&lt;P&gt;After conversion I realized some future dates&amp;nbsp;for instance '2Oct2027' is being converted to '2Oct 1927' instead. Please how do I correct such an error to reflect the correct sas date of '2Oct2027'.&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Sep 2018 19:20:32 GMT</pubDate>
    <dc:creator>bbortey</dc:creator>
    <dc:date>2018-09-05T19:20:32Z</dc:date>
    <item>
      <title>SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492768#M129554</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have converted a character variable to sas date&amp;nbsp;for calculation.&lt;/P&gt;&lt;P&gt;After conversion I realized some future dates&amp;nbsp;for instance '2Oct2027' is being converted to '2Oct 1927' instead. Please how do I correct such an error to reflect the correct sas date of '2Oct2027'.&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 19:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492768#M129554</guid>
      <dc:creator>bbortey</dc:creator>
      <dc:date>2018-09-05T19:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492775#M129563</link>
      <description>&lt;P&gt;Are you sure you converted the character expression to an actual SAS date? Show us your code.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 19:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492775#M129563</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-05T19:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492779#M129566</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; CO_BORR_DOB &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;CO_BORR_DOB1=input(CO_BORR_DOB ,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; CO_BORR_DOB1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;the above is the code. The 'CO_BORR_DOB is character variable converted to numeric variable in step 2.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 19:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492779#M129566</guid>
      <dc:creator>bbortey</dc:creator>
      <dc:date>2018-09-05T19:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492785#M129569</link>
      <description>&lt;P&gt;Works for me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   CO_BORR_DOB='2Oct2027';
   CO_BORR_DOB1=input(CO_BORR_DOB ,date9.);
   format CO_BORR_DOB1 date9.;
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Sep 2018 19:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492785#M129569</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-05T19:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492823#M129592</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230951"&gt;@bbortey&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have converted a character variable to sas date&amp;nbsp;for calculation.&lt;/P&gt;
&lt;P&gt;After conversion I realized some future dates&amp;nbsp;for instance '2Oct2027' is being converted to '2Oct 1927' instead. Please how do I correct such an error to reflect the correct sas date of '2Oct2027'.&lt;/P&gt;
&lt;P&gt;thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What you say is quite likely related to the use of two-digit years some where. Depending on the value of your option YEARCUTOFF a two-digit year is assumed to be in 1900's if the value is less.&lt;/P&gt;
&lt;P&gt;Run this code snippet:&lt;/P&gt;
&lt;PRE&gt;proc options option=yearcutoff;run;&lt;/PRE&gt;
&lt;P&gt;and see if the log shows something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; YEARCUTOFF=1926   Specifies the first year of a 100-year span that is used by date informats and
                   functions to read a two-digit year.&lt;/PRE&gt;
&lt;P&gt;or any value smaller than 1927.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution, depending on your range of dates may be to set the YEARCUTOFF later than your problem year.&lt;/P&gt;
&lt;P&gt;OR provide examples of the actual original character values and the code you used to do the conversion.&lt;/P&gt;
&lt;P&gt;For instance when I run this code:&lt;/P&gt;
&lt;PRE&gt;data example;
   x='02OCT27';
   /* my yearcutoff is 1926 which I believe is the current default for &lt;BR /&gt;   SAS 9.4*/
   y=input(x,date7.);
   format y date9.;
run;&lt;/PRE&gt;
&lt;P&gt;The Y value is 02OCT1927.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 21:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-date/m-p/492823#M129592</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-05T21:12:02Z</dc:date>
    </item>
  </channel>
</rss>

