Date: Thu, 29 Jun 2006 10:33:54 -0700
Reply-To: tanwan <tanwanzang@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: tanwan <tanwanzang@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: Validating date date
In-Reply-To: <BAY101-F34A46736D4D661838445C3DE7C0@phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"
SAS will never accept INVALID dates, so all you to check for invalid
dates is to convert them (I guess from char variables) to SAS dates.
Invalid dates (past and future) will be set to missing. For example,
2007 is will not be a leap year but 2008 is, November has 30 days in
every year, and no month has 32 days!
data INVALID;
input pseudodate anydtdte10.;
format pseudodate date9.;
datalines;
29/02/2007
31/11/2004
32/09/2006
proc print;run;
data REAL;
input gooddate anydtdte10.;
format gooddate date9.;
datalines;
29/02/2008
30/11/1968
12/09/2006
proc print;run;
|