Date: Tue, 14 Feb 2006 14:45:37 -0600
Reply-To: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Subject: Re: convert to date format
Content-Type: text/plain; charset=US-ASCII
If you need 01 as the day then you may use yymmn6. informat. Otherwise
the following can be used for any day. The code used 15 as the day of
month:
data temp(keep=ChangedD);
format ChangedD mmddyy10.;
input time_key $ 1-6;
ChangedD=input(time_key||'15',yymmdd8.);
datalines;
200202
200203
200204
200205
200206
;
run;
proc print;
run;
***** Output *****
The SAS System 12:54
Tuesday, February 14, 2006 4
Obs ChangedD
1 02/15/2002
2 03/15/2002
3 04/15/2002
4 05/15/2002
5 06/15/2002
J S Huang
1-515-557-3987
fax 1-515-557-2422
>>> baogong jiang <bgjiang@GMAIL.COM> 2/14/2006 2:16:02 PM >>>
hello:
I need to convert the following column to a date format.
time_key
200202
200203
200204
200205
200206
thank you in advance!
baogong