Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching for files reaching file version limit

Status
Not open for further replies.

MartijnNL

Technical User
Dec 1, 2014
3
US
I want to do a check on files reaching the file version limit. Tried the solution mentioned at thread951-1266570 but that one did not work. I created a file that is above the threshold of 20000. It did not find that file.

>dir test.txt

Directory xxx:[EXE.USER]

TEST.TXT;20100 TEST.TXT;1

Total of 2 files.
> @check_file_versions

>> Reporting on versions greater than 20000 <<

All file versions within specs.
All file versions within specs.
All file versions within specs.
All file versions within specs.

I found a similair routine somewhere else but that one had the same problem:

Code:
$ v = 'f$verify(0)                      ! find high version numbers
$ show device d/moun/out=disks.lis      ! get a list of disks
$ open md disks.lis                     ! start reading list of disks
$ v = 'f$verify(0)                      ! find high version numbers
$ show device d/moun/out=disks.lis      ! get a list of disks
$ open md disks.lis                     ! start reading list of disks
$ read md sl/end=have_disks     ! blank line
$ read md sl/end=have_disks     ! device ...
$ read md sl/end=have_disks     ! name ...
$ on control_y then goto have_disks
$r: read md sl/end=have_disks
$ if f$edit( f$extr( 0,5, sl), "collapse") .eqs. "" then goto r ! skip wrtlck
$ on error then goto r
$ on severe then goto r
$ s = f$extr( 0,12, sl)+"[000000...]*.*"
$ ivs = f$edit( s,"collapse")
$ write sys$output "working on ",f$parse( ivs, ,,"DEVICE")," ",f$time()
$s: fs = f$search(ivs)
$ if fs .eqs. "" then goto r
$ v = f$parse( ivs, ,,"version") - ";"
$ if v .gt. 32000 then write sys$output ivs
$ goto s
$have_disks:
$ close md
$ dele disks.lis;/nolog
$ exit 1+ 0*f$verify(v)

That gives the following output:

> @FIND_HIGH_VERSION_NUMBERS.COM
working on $1$DKA0: 7-JAN-2015 14:13:18.77
working on $1$DKA1: 7-JAN-2015 14:13:18.77
working on $1$DKA2: 7-JAN-2015 14:13:18.77
working on $1$DKA3: 7-JAN-2015 14:13:18.77
working on $1$DKA4: 7-JAN-2015 14:13:18.77

Could this have something to do the VMS version? We are on OpenVMS V7.3-2
 
How about something simpler like:


$ del version_max.txt;*
$ dir disk$1:[000000...]/select=version=minimum=30000/out=version_max.txt
$ if (f$file_attributes("version_max.txt","FFB").ne.0)
$ then
$ write sys$output "FILE(S) WITH VERSION NUMBER > 30,000 DETECTED (32,768 MAX ALLOWED) - SEE version_max.txt"
$ ENDIF



In order to understand recursion, you must first understand recursion.
 
I tried this line but it gives an error:

%IVKEYW, unrecognized keyword - check validity and spelling
\VERSION
I looked for it in the VMS HELP for the DIR command but there is no /VERSION in there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top