libname lib sqlsvr dsn=EIS schema=SYS user="username" password="password" READBUFF=1000;
proc sql /*outobs=1*/ noprint;
create table a as select modify_date, NAME into :cif separated by ' '
from Libname.TABLES where NAME LIKE "table_name%" order by modify_date desc;
proc sort; by modify_date;
quit;
data _null_;
set a end=last;
if last;
call symput('outy',compress(name));
run;
Macro variable "OUTY" will contain the name of the latest dataset.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.