Hi guys,
suppose to have the following:
data DB;
input ID :$20. Discharge :date9. Discharge_n :date9.;
format Discharge :date9. Discharge_n :date9.;
cards;
0001 13FEB2019 .
0001 01FEB2019 28FEB2019
0002 01FEB2020 .
0002 04FEB2020 28FEB2020
;
then you want to update Discharge (all the fields, missings and not) with the variable Discharge_n to get:
data DB1;
input ID :$20. Discharge :date9. Discharge_n :date9.;
format Discharge date9. Discharge_n :date9.;
cards;
0001 28FEB2019 .
0001 28FEB2019 28FEB2019
0002 28FEB2020 .
0002 28FEB2020 28FEB2020
;
If I use the rule: if discharge_n > discharge only the corresponding row will be updated but I would like to update all rows corresponding to the same ID.
Can anyone help me please?
Thank you in advance