|
Larry,
When you assign year values with leading zeroes, the date INFORMAT reads it
as two year digits. So you are in effect reading in a two digit year value.
The YEARCUTOFF system option is used to assign the century. So, what you
have observed is not a bug.
See v6 documentation or SAS Note V6-INFORMATS-0573 for more on this:
Venky
#****************************************#
# E-mail: venky.chakravarthy@pfizer.com #
# swovcc@hotmail.com #
# Phone: (734) 622-1963 #
#****************************************#
-----Original Message-----
From: Kaskey, Larry [mailto:LKaskey@SEISINT.COM]
Sent: Monday, December 10, 2001 10:43 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: sas dates
I am trying to check for invalid dates...here is my code...
data _null_;
file print;
length dob $10;
infile 'h:\data_cleanse\test_file.txt' dlm='*' missover dsd;
input
dob $
dob2 = input(dob,mmddyy10.);
if dob = . then put dob= dob2=;
run;
Now, I put in as the first date a year of 0000...so the first record's date
looks like this....'07/16/0000' I expected this to be invalid, but instead,
SAS appears to interpret this as 07/16/2000 and converts it to the sas date
14807...I have a feeling this is something that most people here are aware
of, but if someone can provide an explanation or a way for me to test for
invalid dates of this nature, I would greatly appreciate it.
Thanks,
Larry Kaskey
ETL Developer
Seisint,Inc
561-999-4597
|