Something similar to this should do it:
libname TD teradata noprompt = "< Teradata connection string>" DATABASE = MyDatabase schema = MySchema;
proc sql;
create table Want as
select A.ID1
,A.ID2
,A.Date
from TD.Have as A
inner join
(select ID1
,ID2
,max(Date) as Max_Date
from TD.Have
group by ID1
,ID2
) as B
on A.ID1 = B.ID1
and A.ID2 = B.ID2
and A.Date = B.Max_Date
;
quit;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.