DATA Step, Macro, Functions and more

Change modte date

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Change modte date

[ Edited ]

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?


Accepted Solutions
Solution
‎02-02-2017 01:44 AM
Super User
Posts: 5,255

Re: Change modte date

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


All Replies
PROC Star
Posts: 549

Re: Change modte date

You are missing a % in front of your second sysfunc Smiley Happy

Solution
‎02-02-2017 01:44 AM
Super User
Posts: 5,255

Re: Change modte date

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
Super User
Super User
Posts: 7,392

Re: Change modte date

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 122 views
  • 1 like
  • 4 in conversation