Hi I am trying to have the date stay the same in both of these data sets and then remain the same after they combine I do this step and they both show just a year for the date which is what I want data work.vchange;
set new.vital;
if hepb_date ne '?' then do;
hbv2 = input(hepb_date, YYMMDD10.);
end;
format bcdob Dt_birth hbv2 yymmdd10.;
dtbirth=dt_birth; cdob=bcdob;
drop Dt_Birth BCDOB hepb_date;
format bcdob dtbirth cdob Dt_birth hbv2 year.;
run; and then I get this result : I then do somethin similar in the fo the other piece of data data work.nchange;
set new.ncac;
Dtbirth = input(Dt_birth, 8.);
if BCDOB^='NULL' then do;
CDOB = input(BCDOB, 8.);
end;
hbv2 = hepb_date;
format hbv2 year.;
format CDOB Dtbirth 8.;
drop bcdob dt_birth hepb_date;
run; and get this but as soon as I combine them they get all messed up and the year doesn't match the set before it looks like this: data work.complete;
set work.nchange work.vchange;
run; some do remain the same but my thought is that the ones that are saved as dates in one data set get changed to numeric values once combined. How do i get this from not happening and keep the year?
... View more