Dear all, For the following sample dataset I need to retrieve the last value of DATE and TIME within each group (variableID). data have; ID DATE TIME 50001 01/02/2018 112132 50001 12/12/2018 141625 50001 22/09/2018 204958 50001 02/05/2018 115545 50002 14/08/2018 110038 50002 27/11/2018 125737 50002 23/06/2018 105847 50002 22/12/2018 111211 50003 12/08/2018 120045 50003 14/08/2018 105922 50003 11/09/2018 103040 50003 13/08/2018 141713 run;; Therefore the output shall be: ID DATE TIME 50001 22/09/2018 204958 50001 12/12/2018 141625 50002 27/11/2018 125737 50002 22/12/2018 111211 50003 14/08/2018 105922 50003 11/09/2018 103040 I have the following code but it only shows me the last one, data want;
if 0 then set have;
call missing(dt);
do until(last.id);
set have;
by id;
dt=dt<>dhms(date,0,0,time);
end;
drop dt;
run; Thank you all.
... View more