|
Let the SAS informat do the work, then use either the year function or
format:
data _null_;
length date 8;
input date ddmmyy.;
year=year(date);
put (date date date) (=date7. =year2. =year4.) year=;
cards;
10698
220599
270800
;
run;
date=01JUN98 date=98 date=1998 year=1998
date=22MAY99 date=99 date=1999 year=1999
date=27AUG00 date=00 date=2000 year=2000
HTH,
Scott
"Hala" <hala.maktabi@gmail.com> wrote in message
news:1154551928.485504.27190@b28g2000cwb.googlegroups.com...
> hi all,
>
> given the following list of dates ddmmyy::
>
> 10698
> 220599
> 270800
> ..
>
> and given that the length varies between 5 and 6 depending on whether
> the day is between 1and 9 or not,
> How can I extract the last two digits which represent the year?
>
> Thanks alot :)
>
> Hala
>
|