BookmarkSubscribeRSS Feed

To get the latest dataset in the Library

Started ‎10-15-2014 by
Modified ‎10-05-2015 by
Views 1,031

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;



data _null_;

set a end=last;

if last;

call symput('outy',compress(name));



Macro variable "OUTY" will contain the name of the latest dataset.

Version history
Last update:
‎10-05-2015 03:36 PM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels
Article Tags