BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vraj1
Quartz | Level 8

I want to extract modified date of a dataset using proc contents. 

 

Any example or suggestion please

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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;

View solution in original post

2 REPLIES 2
ChrisBrooks
Ammonite | Level 13

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.

Kurt_Bremser
Super User

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 18671 views
  • 3 likes
  • 3 in conversation