Date: Mon, 8 Nov 2010 14:15:41 -0500
Reply-To: Randy Herbison <RandyHerbison@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Randy Herbison <RandyHerbison@WESTAT.COM>
Subject: Re: Time > 24:00 is OK in SAS?
In-Reply-To: <201011081833.oA8HQOPM027934@willow.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
I don't see the format of your datetime value among those supported by the ANYDTDTM informat. Try the YMDDTTM informat and you'll see that it increments the date value:
130 data _null_;
131 dt=input('2010-08-18 30:00:00',YMDDTTM.);
132 put dt datetime.;
133 run;
19AUG10:06:00:00
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Dave
Sent: Monday, November 08, 2010 1:34 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Time > 24:00 is OK in SAS?
Hi All,
Can anyone explain to me why SAS doesn't flag a time > 24:00 as any error?
data dave;
input start_dt :ANYDTDTM.;
format start_dt datetime.;
cards;
2010-08-18 30:00:00
;
run;
proc print;
run;
SAS tells me that an invalid date (ex, Nov 31) will be flagged, but they
don't flag times > 24:00 as an error. How can you have more than 24 hours
in a day?
Because of this, I can't use the ANYDTDTM. as an INFORMAT. I must now
interrogate the field and look at the time portion.
Thoughts?
Dave