|
The ANYDTDTE function comes in handy here as well as situations with other
character date variables:
date
09-Apr-07
09/Apr/08
09/Apr/08
Apr08
04092008
20080409
_date=input(date,ANYDTDTE11.);
format _date mmddyy10.; * assign date format of your choice;
date _date
09-Apr-07 04/09/2007
09/Apr/08 04/09/2008
09/Apr/08 04/09/2008
Apr08 04/01/2008
04092008 04/09/2008
20080409 04/09/2008
Robin High
UNMC
n <nikhil.abhyankar@GMAIL.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
08/19/2008 01:26 AM
Please respond to
n <nikhil.abhyankar@GMAIL.COM>
To
SAS-L@LISTSERV.UGA.EDU
cc
Subject
how to convert char variables into a date format?
Hi all;
I have a char9 variable which actually holds dates like, 09-Apr-07.
I get an error, The informat $DATE was not found or could not be
loaded. when I try using,
data want; set have;
informat date DATE7. ;
run;
Could anybody please tell me what is going wrong and how could I
change the informat of the char type variable to a date informat?
|