Date: Fri, 18 Feb 2005 15:32:21 -0500
Reply-To: Nathaniel_Wooding@DOM.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel_Wooding@DOM.COM>
Subject: Re: creating sas date from mixed format variable
Content-type: text/plain; charset=US-ASCII
Nevin
For the cases that you give mmddyy10. works for me.
Nat Wooding
data old;
input olddate $16.;
cards;
01/01/2003
2/5/2004
4/14/04
;
run;
data work.new;
set old;
newdate=input(olddate,mmddyy10.);
format newdate mmddyy10.;
proc print;
run;
nevin
<nevinkrishna@HOT To: SAS-L@LISTSERV.UGA.EDU
MAIL.COM> cc:
Sent by: "SAS(r) Subject: creating sas date from mixed format variable
Discussion"
<SAS-L@LISTSERV.U
GA.EDU>
02/18/05 03:01 PM
Please respond to
nevin
hello,
i have been stumped on a date question and hope you have some insight.I
have a dataset with a date field in which the dates are in differing
styles (ie..some records have 2 digit years others 4, etc...). i am
trying to create a new date field that is the sas date value for this
problematic variable.below i made an example, but when i run the the
second part of the program (data work.new step)the newdate field is
missing..any ideas ? thanks,nevin
data old;
input olddate $16.;
cards;
01/01/2003
2/5/2004
4/14/04
;
run;
/*This section does not work*/
data work.new;
set old;
newdate=input(olddate,date9.);
run;