BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am looking for a piece of code I can run that will show me the last time my datasets in my librarys were modified.

Is this possible?
5 REPLIES 5
deleted_user
Not applicable
proc datasets library=yourLIB details ; run;
deleted_user
Not applicable
Is there a way to run this for multiple libraries or do I just have to do mutiple proc datasets statements?
deleted_user
Not applicable
probably simpler to maintain as multiple lines.

If you have a lot of these, what will youwant to do with the output?
deleted_user
Not applicable
keeping it as an HTML is fine. I am just trying to see if the data has been updated for the day
deleted_user
Not applicable
you might prefer the selection from the environment reporting tables updated in the last, say, 3 days. That is a little different [pre]%let over = 3 ;
%let since= %sysfunc( intnx( days, "&sysdate9"d, -3 ), date9 ) ;
proc sql ;
create table recent_updates as
select * from dictionary.tables
where libname ne 'SASHELP' and libname ne 'WORK'
and moDate > "&since:0:0"dt
order by moDate descending ;
;
quit;[/pre]
For your environment, you may want to add other libraries from which you want no information, like SASHELP and WORK
That could have produced the report direct from sql, but I feel I have more control in proc print like the following [pre]
proc print data= recent_updates ;
id libname memname;
var nobs nvar modate ;
run;[/pre]

Without the moDate filter, you can report all datasets.


PeterC

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1444 views
  • 0 likes
  • 1 in conversation