Date: Fri, 7 Jul 2006 09:36:01 -0400
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: date validation
If I try to interpret: maybe the char - dates are of the format ddmmyy10.
Means, the dates are all like
uups, sent too fast....
where the first one is ok and the second one isn't.
But what is meant with "fall outside todays 1date"? Todays date is
07.07.2006 - is that the only one which is correct?
That is simple:
if input(char_date,ddmmyy10.)=today() then ok=1;
If you only test if the date is formal correct and fits to the gregorian
calender (within certain limits also in the future), you should simply try
to convert them with the INPUT function and the desired format. If you get a
missing as result and the variable _error_ is set to 1, the date is not
Perhaps that is not enough. A date like
01/01/03 might also be accepted. If that is not allowed, you might need more
criterias, e.g. the length of the string.
On Fri, 7 Jul 2006 06:50:44 -0400, Jim Groeneveld <jim2stat@YAHOO.CO.UK> wrote:
>I don't quite understand what you are saying. You have two dates as
>character fields and the rest as numeric fields. So far so good if with
>numeric you mean the number of days since 01jan1960 and not a number which
>contains a recognizable day, month and year part.
>Next you say your QC has to make sure the dates are all of the format
>DDMMYY10. That is what I don't understand: dates are stored as either
>character values (with a certain format, like DDMMYY10.) or numeric values
>without a format, to be presented with _any_ format, like DDMMYY10. The
>last storage form is best: N of days since 01jan1060, stored in 8 bytes
>(the default for numeric values). You can make direct calculations with
>So maybe you could elaborate a little bit more on what your QC actually
>demands for date fields.
>Regards - Jim.
>Jim Groeneveld, Netherlands
>Statistician, SAS consultant
>On Fri, 7 Jul 2006 03:31:07 -0700, jeli0703@HOTMAIL.CO.UK wrote:
>>Was wondering if anyone can help my friday mind block
>>I have a dataset with a number of variables in it, some of which are
>>However 2 of the date variables are in character format whilst all the
>>others are numeric, thus i can assume that if it was incorrect it would
>>i need to pass it through a quality check to make sure that the dates
>>are in the correct format ddmmyy10. and if they fall outside todays
>>date then suspend that observation otherwise good data.