From: Jay Jacob Wind on
Lene Blenstrup writes
> I'm trying to merge two files by date of birth, but they are not alike..
>
> In one file it's a numeric SAS date (as I understand it, number of days
> since 1.1.1960!?) and in the ohter it's a character variable in the format
> YYYYMMDD
>
> Hope, that someone could tell me how to transform the numeric variable to
> be like the other...


SAS takes care of that problem, if you read both dates into a SAS date field.

Example:

data one;
date='01jan2007'D; firstname='Jay';
run;

data two;
date=input('20070101',yymmdd8.); lastname='Wind';
run;

data three;
merge one two;
by date;

proc print;
run;

yields this result:

Obs date firstname lastname

1 17167 Jay Wind

Then you can use any valid SAS format to display the date, for example,

proc print;
format date mmddyy10.;
run;

yields this result:

Obs date firstname lastname

1 01/01/2007 Jay Wind

-- Thank you, and best wishes
-- Jay Wind