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

Is it possible to change the last modified date of a SAS Dataset? I have a SAS Dataset (let's call it result.sas7bdat), using powershell, I already change the created date and last modified date. However, when I use this line of code

 

%let olddataid=%sysfunc(open(MYLIB.RESULT));

%let timestamp = %sysfunc(attrn(&newdataid,modte));

 

the timestamp still shows the original modified date, is there anyway to permanently change the last modified date?

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

What do you want to change it to?

If the current datetime just do a harmless edit of the data set. Otherwise, I don't know.

 

Even if this is not my business, but is it wise to tamper with created/update timestamps? They do tell you something and is useful for audit and maintenance purposes.

 

Fun fact: created timestamp can be changed within SAS using the DTC= option in PROC DATASETS, MODIFY statement.

Data never sleeps

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

You are missing a % in front of your second sysfunc 🙂

LinusH
Tourmaline | Level 20

What do you want to change it to?

If the current datetime just do a harmless edit of the data set. Otherwise, I don't know.

 

Even if this is not my business, but is it wise to tamper with created/update timestamps? They do tell you something and is useful for audit and maintenance purposes.

 

Fun fact: created timestamp can be changed within SAS using the DTC= option in PROC DATASETS, MODIFY statement.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You would never want to, it is an audit nightmare.  Anyways, if your changing the timestamp of the file to something, then the act of changing it, is in of itself a change, and hence the timestamp should be that.

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
  • 3 replies
  • 2097 views
  • 1 like
  • 4 in conversation