1827474 Members
2323 Online
109965 Solutions
New Discussion

Re: File version limit

 
IFX_1
Frequent Advisor

File version limit

Hi All,
Do you know of any lexical where I can get the latest file revision number?
10 REPLIES 10
David B Sneddon
Honored Contributor

Re: File version limit

Ronald,

Do you mean "revision" or "version"?

$ write sys$output f$parse(f$search("sys$login:login.com"),,,"version")
;194
$ write sys$output f$file_attributes("sys$login:login.com","rvn")
1

Dave

Volker Halle
Honored Contributor

Re: File version limit

Ronald,

or do you mean the FILE VERSION LIMIT ?

$ write sys$output f$file_attributes("LOGIN.COM","VERLIMIT")
32767

(with 32767 indicating no version limit set).

The file version limit indicates, how many versions of the file may exist ($ HELP SET FILE/VERSION_LIMIT).

Volker.
IFX_1
Frequent Advisor

Re: File version limit

Hi David,
I refer to the file version number. Citing login.com;1, if I do

write sys$output f$file_attributes("sys$login:login.com","rvn")

The result should be 1. I try to use the above, I get 2 as result.
Volker Halle
Honored Contributor

Re: File version limit

Ronald,

the RVN (=Revision number) indiciates, how often the existing file was accessed for WRITE.

$ OPEN/READ/WRITE x LOGIN.COM
$ CLOSE x

The RVN will have been updated by one.

To obtain the file version number, use F$PARSE(...,"VERSION")

Volker.
Andy Bustamante
Honored Contributor

Re: File version limit

Hi Ronald,

You can also use relative version numbers. For example,

login.com;
login.com;0

Both give the latest version

login.com;-1
login.com;-2

and so on provide previous versions of your file.

login.com;-0

is the earliest version of the file.


Andy
If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net
IFX_1
Frequent Advisor

Re: File version limit

Hi Volker,
Can you expound your statement "To obtain the file version number, use F$PARSE(...,"VERSION")"?

What's the correct syntax to get the file version number?
Karl Rohwedder
Honored Contributor

Re: File version limit

$ dir con2.log.

Directory CNC_SCRATCH:[ROHW.ROHWEDDER]

CON2.LOG;20
$ a=F$Search("con2.log")
$ write sys$output f$parse(a,,,"version")
;20


regards Kalle
Dave Laurier
Frequent Advisor

Re: File version limit

Hi Ronald,

I think what is meant is this:

$ write sys$output f$parse ("SESSIONLOG.COM","[]",,"VERSION")
;

$ write sys$output f$parse ("SESSIONLOG.COM;-2","[]",,"VERSION")
;-2

Best regards,

Dave Laurier
IFX_1
Frequent Advisor

Re: File version limit

This is how I do it...

$ s = f$search("*.*")
$ xx= f$element(1,";",f$parse(s,,,"version","no_conceal"))
$ sh sym xx
XX = "3"

Later I will add a condition to check file with file version nearly reach 32767.

IFX_1
Frequent Advisor

Re: File version limit

thanks.