UNIX cp (and, IIRC, Windows copy) will create a new file with a new timestamp, unless you use the -p option (preserve attributes). mv, OTOH, will keep as much of the attributes as possible (depending on who runs it and who owns the original file).
You're using SAS to copy the program? I wouldn't use SAS. I would use an operating system command. Operating system commands will actually copy. SAS is creating a new program that is a copy of the original, and the timestamp will reflect the time that the new program was created.
If you need to use SAS to manage when the copies are made, you can use SYSTASK or the X command to launch OS level commands from within SAS.
Jim
It's getting changed when using an X command? That's unusual.
What operating system are you running under? What command are you using? Do the source and the target directories have the same operating system? I've seen weird things happen if a UNIX directory is mapped to Windows.
Are the source and target directories in the same time zone? For example my EG session is running in Pacific Time, but my SAS is running in Central Time.
Jim
And what command specifically are you using to execute the copy?
Are there any peculiarities about either of these two UNIX environments?
In what way are the timestamps in error? I assume that the copy has the date-time of when it was copied not the date-time of the original, is that correct?
Jim
UNIX cp (and, IIRC, Windows copy) will create a new file with a new timestamp, unless you use the -p option (preserve attributes). mv, OTOH, will keep as much of the attributes as possible (depending on who runs it and who owns the original file).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.