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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.