×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

searching for files reaching file version limit

searching for files reaching file version limit

searching for files reaching file version limit

(OP)
I want to do a check on files reaching the file version limit. Tried the solution mentioned at thread951-1266570: Display Directory with Versions almost to the limit but that one did not work. I created a file that is above the threshold of 20000. It did not find that file.

Quote:

>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:

Quote:

> @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

RE: searching for files reaching file version limit

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.

RE: searching for files reaching file version limit

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close