LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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>
Subject:   Re: Validating date date
Comments:   To:
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;

Back to: Top of message | Previous page | Main SAS-L page