I want to extract modified date of a dataset using proc contents.
Any example or suggestion please
It is easier to retrieve that from dictionary.tables:
proc sql;
create table test as select * from dictionary.tables where libname='SASHELP' and memname = 'CLASS';
create table test2 as select modate from dictionary.tables where libname='WORK' and memname = 'TEST';
quit;
You can get the date of the last modification by writing the Proc Contents output to a data set like so
data class;
set sashelp.class;
run;
proc contents data=class out=contents;
run;
The modification date is then held in a datetime variable called MODATE and you can access the date portion of that with the DATEPART function using data step, proc SQL etc.
It is easier to retrieve that from dictionary.tables:
proc sql;
create table test as select * from dictionary.tables where libname='SASHELP' and memname = 'CLASS';
create table test2 as select modate from dictionary.tables where libname='WORK' and memname = 'TEST';
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.