I like to get more for less Coalesce these date variables to select where only one is non-missing or "product" them to select where all are non-missing PROC SQL ; create table final as select coalescec( a.id, b.id, c.id ) as abc_id , coalescec( a.place, b.place, c.place) as abc_place , coalesce( a.date, b.date, c.date) as abc_date , max( a.date, b.date, c.date) as latest_date , min( a.date, b.date, c.date) as earliest_date , * From test1 a full join test2 b on a.ID = b.ID and a.Place = b.Place full join test3 c on a.ID = c.ID and a.Place = c.Place where a.date * b.date *c.date is not null (Alternatively Where latest_date is not null) order by abc_ID, abc_place; quit; Sorry this is untested as I haven't yet found a way of testing sas code on this smartphone
... View more