Elena,
This
should do the trick – just convert the numeric variable to a string and input
through the yyddmm10. format. If
you don't mind a warning message the compress() function is the easiest way to
convert a number into a string:
data _null_;
nv=19680905;
datevar=input(compress(nv),yymmdd10.);
put _all_;
run;
HTH
David Ward
-----Original
Message-----
From: SAS(r) Discussion
[mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Zhonghe
Li
Sent: Thursday, February 21, 2002
12:26 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: how to convert numeric to
date variables?
Hi
everyone,
We have
four numeric variables: brithdate 19680905 (it is of YYYYMMDD sequence but a
numeric variable); and then we have Year, Month, and Day Variables of numeric
type. We need to convert it to a SAS date variable so that we can get the
age. Can you tell me how to do this?
Thank
you.
Elena