<?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 Re: Different date types in one variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524569#M142650</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And what should be the result of&lt;/P&gt;
&lt;PRE&gt;121110&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;December 11, 2010&lt;/LI&gt;
&lt;LI&gt;November 12, 2010&lt;/LI&gt;
&lt;LI&gt;November 10, 2012&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Just to illustrate that your issue is non-solvable at the core. Return such inconsistent data to sender, unless sender provides a complete ruleset that covers all cases present in the files.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And do not forget the possibility of years 1910 or 1912.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 15:06:05 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-01-04T15:06:05Z</dc:date>
    <item>
      <title>Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524544#M142641</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable with diffrent date types. I want to apply one date type to all the observation in the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;input dd;&lt;BR /&gt;cards;&lt;BR /&gt;20180118&lt;BR /&gt;18jan2018&lt;BR /&gt;011818&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;result data&lt;/P&gt;&lt;P&gt;18jan2018&lt;BR /&gt;18jan2018&lt;BR /&gt;18jan2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there is any approach for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 13:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524544#M142641</guid>
      <dc:creator>sanjay1</dc:creator>
      <dc:date>2019-01-04T13:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524545#M142642</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input dd :$10.;
cards;
20180118
18jan2018
011818
;
run;

data want;
set a;
want=input(dd,anydtdte10.);
format want date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jan 2019 13:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524545#M142642</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-04T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524546#M142643</link>
      <description>&lt;P&gt;Use the ANYDTDTE informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    input dd anydtdte12.;
    format dd date7.;
    cards;
20180118
18jan2018
011818
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jan 2019 13:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524546#M142643</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-04T13:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524547#M142644</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the anydtdte informat :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
keep dd;
format dd date9.;
input dd anydtdte.;
cards;
20180118
18jan2018
011818
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jan 2019 14:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524547#M142644</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-01-04T14:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524552#M142645</link>
      <description>&lt;P&gt;The blog post &lt;A href="https://blogs.sas.com/content/iml/2016/11/11/anydtdte-informat-read-any-date-sas.html" target="_self"&gt;One informat to rule them all&lt;/A&gt;&amp;nbsp;describes the&amp;nbsp;&lt;SPAN&gt;ANYDTDTE informat well.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 14:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524552#M142645</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-04T14:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524566#M142649</link>
      <description>&lt;P&gt;And what should be the result of&lt;/P&gt;
&lt;PRE&gt;121110&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;December 11, 2010&lt;/LI&gt;
&lt;LI&gt;November 12, 2010&lt;/LI&gt;
&lt;LI&gt;November 10, 2012&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Just to illustrate that your issue is non-solvable at the core. Return such inconsistent data to sender, unless sender provides a complete ruleset that covers all cases present in the files.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524566#M142649</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-04T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524569#M142650</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And what should be the result of&lt;/P&gt;
&lt;PRE&gt;121110&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;December 11, 2010&lt;/LI&gt;
&lt;LI&gt;November 12, 2010&lt;/LI&gt;
&lt;LI&gt;November 10, 2012&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Just to illustrate that your issue is non-solvable at the core. Return such inconsistent data to sender, unless sender provides a complete ruleset that covers all cases present in the files.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And do not forget the possibility of years 1910 or 1912.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524569#M142650</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-04T15:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524586#M142662</link>
      <description>&lt;P&gt;As explained in &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s link the DATESTYLE option can be used to&lt;/P&gt;
&lt;P&gt;handle such ambiguities&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro inputDate(ds);

option DATESTYLE="&amp;amp;ds.";

data have_&amp;amp;ds.;
format dd date9.;
dd=input("121110",anydtdte.);
run;

%mend;

%inputDate(MDY);
%inputDate(DMY);
%inputDate(YMD);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524586#M142662</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-01-04T15:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524595#M142667</link>
      <description>If the time span does not exceed a hundred years, this can be dealt with using YEARCUTOFF option.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197881.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197881.htm&lt;/A&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524595#M142667</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-01-04T16:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524622#M142676</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30622"&gt;@gamotte&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;If the time span does not exceed a hundred years, this can be dealt with using YEARCUTOFF option.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197881.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197881.htm&lt;/A&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I understand and have used the year cutoff values for a number of projects as I deal with dates of birth that precede 1920 (by more that a bit). The point was that a 6-digit "date" is very problematic for a large range of values. And the yearcutoff may be very off for these 6-digit values as the cutoff is likely applied to the last 2 digits and if the year were actually in the first 2 the result is suspect at best.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We didn't even go into some of the year and month only formats we have had people try to use. 200302 could be 20&amp;nbsp;Mar 2002 or 1902, or Feb 2003 with no specific day of the month.&lt;/P&gt;
&lt;P&gt;Some of the potential date values generated by ANYDTDTE informat may be incorrect or return missing and the user will need to supply the rules for handling the problematic values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then there are Julian dates such as 2012. (12Jan2002).&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 17:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524622#M142676</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-04T17:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Different date types in one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524650#M142687</link>
      <description>&lt;P&gt;With such crappy "data", you can't be sure that YMD/DMY/MDY is consistent.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-date-types-in-one-variable/m-p/524650#M142687</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-04T18:48:48Z</dc:date>
    </item>
  </channel>
</rss>

