Operating System - OpenVMS
1755411 Members
4767 Online
108832 Solutions
New Discussion юеВ

VMS File cration Date change

 
SOLVED
Go to solution
Hrishikesha N
New Member

VMS File cration Date change

How can I change the creation date of a OLD dated file in VMS V5.1 ?
9 REPLIES 9
Willem Grooters
Honored Contributor
Solution

Re: VMS File cration Date change

AFAIK: Cannot be done. Not directly, at least.

If you COPY the file, the new verion will get today's date. (You could get it to any given date by changing the system date and time and copy the file, but I do not recommend that).
If you wish, you can then purge, and rename the newly created file to the version it originally had.

Just wondering: why would you want to do this?

Willem
Willem Grooters
OpenVMS Developer & System Manager
Bojan Nemec
Honored Contributor

Re: VMS File cration Date change

Hi,

As Willem mentioned there is no a simple way to change the creation date. You can write a "relative" simple program to change the date. Look at OpenVMS Record Management Services Reference Manual how to do this. The file dates are described in the XABDAT chapter.

Bojan
Hrishikesha N
New Member

Re: VMS File cration Date change

:) Thanks a lot. It works..... I want this to test my program which has to check for daily update from a application.....

Have a Nice time....
Uwe Zessin
Honored Contributor

Re: VMS File cration Date change

I usually use the FILE utility for this task:
http://vms.process.com/scripts/fileserv/fileserv.com?FILE

I have no idea if you can get it working on VAX/VMS V5.1 - I rather doubt it.


Apart from messing with a XABDAT, I think you can also try a CONVERT/FDL. Creating the FDL file is left as an exercise to the reader ;-)
.
Willem Grooters
Honored Contributor

Re: VMS File cration Date change

Uwe,
I doubt CONVERT will help. It will create a new file (with the current date) - so it'
ll work as COPY.

Willem
Willem Grooters
OpenVMS Developer & System Manager
John Gillings
Honored Contributor

Re: VMS File cration Date change

The DFU utility from the freeware distribution has a SET command which can change any date or file attribute to whatever you like.

$ dir/date=create login.com

Directory USER$TSC:[GILLINGS]

LOGIN.COM;67 28-JUL-2004 10:31:39.39

Total of 1 file.

$ mcr dfu set login.com/create=1-jan-2004

Disk and File Utilities for OpenVMS DFU I2.7
Internal Use Only!
Copyright ├В┬й 2000 COMPAQ Computer Corporation

%DFU-S-MODIFIED, File USER$TSC:[GILLINGS]LOGIN.COM;67 modified

%DFU-I-READY, SET command ready
$
$ dir/date=create login.com

Directory USER$TSC:[GILLINGS]

LOGIN.COM;67 1-JAN-2004 00:00:00.00

Total of 1 file.

Be careful! Messing with file dates can have unexpected consequences.
A crucible of informative mistakes
Uwe Zessin
Honored Contributor

Re: VMS File cration Date change

OK, Willem, so you didn't try this exercise?

How about this?
-----
$ convert/fdl=login login.com login2.com
$ write sys$output f$file_attributes("login.com","cdt")
18-AUG-2004 11:31:58.96
$ write sys$output f$file_attributes("login2.com","cdt")
1-JAN-2005 11:22:33.45
$ type login.fdl
IDENT "demo to change dates in FDL"

SYSTEM
SOURCE OpenVMS

FILE
ORGANIZATION sequential

DATE
CREATION "01-JAN-2005 11:22:33.45"

RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT variable
SIZE 0
$
-----
.
Willem Grooters
Honored Contributor

Re: VMS File cration Date change

It's always nice to learn things...
I wasn't aware that you can actually specify a creation date - but like I said: this is like COPY does: creates a new file, you do not change the date of the original. I didn't know of the other possibilities either. (I could have thought about changing using FAB)
BTW: I can think of environments where this 'future creation' would be a nasty thing to do - and certainly if audit doesn't signal this - and I doubt it would! So take care when using this possibility...

Willem
Willem Grooters
OpenVMS Developer & System Manager
Jan van den Ende
Honored Contributor

Re: VMS File cration Date change

.... and if you wish you can also specify
DATE
REVISION
but if you don't, the revision date is current date-time.

Somehow I think that this feature should be reserved to processes with (at least) SECURITY privilege. I don't think Auditors will be enthousiastic though...

Jan
Don't rust yours pelled jacker to fine doll missed aches.