File Version limit Reset - VMS

This is a discussion on File Version limit Reset - VMS ; Hi, I was hoping someone may have already written a DCL procedure for this problem. I have searched but could not find anything. I would like to reset the version number on a file once it reaches or approaches 32767. ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: File Version limit Reset

  1. File Version limit Reset

    Hi,

    I was hoping someone may have already written a DCL procedure for this
    problem. I have searched but could not find anything.

    I would like to reset the version number on a file once it reaches or
    approaches 32767.

    e.g.

    If I had 3 files

    file.dat;32767
    file.dat;32766
    file.dat;32765

    I would like to run the procedure and set the version number on the
    files as follows :

    file.dat;3
    file.dat;2
    file.dat;1

    Hoping someone may be able to help

    Thanks,


  2. Re: File Version limit Reset

    rexruger@gmail.com wrote:
    > Hi,
    >
    > I was hoping someone may have already written a DCL procedure for this
    > problem. I have searched but could not find anything.
    >
    > I would like to reset the version number on a file once it reaches or
    > approaches 32767.
    >
    > e.g.
    >
    > If I had 3 files
    >
    > file.dat;32767
    > file.dat;32766
    > file.dat;32765
    >
    > I would like to run the procedure and set the version number on the
    > files as follows :
    >
    > file.dat;3
    > file.dat;2
    > file.dat;1
    >
    > Hoping someone may be able to help
    >
    > Thanks,
    >


    $ RENAME FILE>DAT;32765 ;1
    $ RENAME FILE.DAT;32766 ;2
    $ REMA

  3. Re: File Version limit Reset

    Richard B. Gilbert wrote:
    > rexruger@gmail.com wrote:
    >>
    >> I would like to reset the version number on a file once it reaches or
    >> approaches 32767.
    >>

    >
    > $ RENAME FILE>DAT;32765 ;1
    > $ RENAME FILE.DAT;32766 ;2
    > $ REMA >


    Although it does not care for locked files, I'm using a procedure posted
    (here ?) 10 years ago:

    http://wwwvms.mppmu.mpg.de/vms$common/sysmgr/FIND_HIGH_VERSIONS.COM

    --

    Joseph Huber - http://www.huber-joseph.de

  4. Re: File Version limit Reset

    rexruger@gmail.com wrote:
    > Hi,
    >
    > I was hoping someone may have already written a DCL procedure for
    > this problem. I have searched but could not find anything.
    >
    > I would like to reset the version number on a file once it reaches or
    > approaches 32767.
    >
    > e.g.
    >
    > If I had 3 files
    >
    > file.dat;32767 file.dat;32766 file.dat;32765
    >
    > I would like to run the procedure and set the version number on the
    > files as follows :
    >
    > file.dat;3 file.dat;2 file.dat;1
    >
    > Hoping someone may be able to help
    >
    > Thanks,
    >


    This procedure requires that you specify the number of versions to save,
    but it will give you a start on saving all versions...


    $! See bottom of file for comments
    $ if f$edit (p1,"collapse,uncomment") .eqs. ""
    $ then
    $ write sys$output "P1 must specify a filename"
    $ exit 44
    $ endif
    $ if f$edit (p2,"collapse,uncomment") .eqs. ""
    $ then
    $ p2 = 1
    $ endif
    $ log_file = f$search (p1)
    $ if log_file .nes. ""
    $ then
    $ version = f$parse (log_file,,,"version") - ";"
    $ log_file = f$element (0, ";", log_file)
    $ keep = f$integer (p2)
    $ if f$integer (version) .gt. 32000
    $ then
    $ purgex 'log_file'/keep='keep'
    $ search = log_file + ";-"
    $ v = 1
    $vloop:
    $ file = f$search ("''search'''keep'")
    $ if file .eqs. ""
    $ then
    $ goto next_v
    $ endif
    $ renamex 'file' *.*;'v'
    $ v = v + 1
    $next_v:
    $ keep = keep - 1
    $ if keep .ge. 0
    $ then
    $ if keep .eq. 0
    $ then
    $ search = search - "-"
    $ endif
    $ goto vloop
    $ endif
    $end_vloop:
    $ endif
    $ endif
    $ exit
    $!++
    $! Description:
    $!
    $! Given a file, purge it to the requested number of versions.
    $!
    $! If the top level version of the file is over 32000, then the
    $! remaining files after the purge will be renamed so the lowest
    $! version number is 1.
    $!
    $! P1 = File to purge (required)
    $! P2 = versions to keep (optional, defaults to 1)
    $!
    $!
    $! Author: James F. Duff
    $!
    $! Date: 24-Mar-2004
    $!
    $! Modifications:
    $!
    $! Who Date Version What
    $!
    ------------------------------------------------------------------------
    $! JFD 24-Mar-2004 X01-00 Original version of module
    $!
    $!--

    Cheers,
    Jim.
    --
    www.eight-cubed.com

  5. Re: File Version limit Reset


    I no longer have the source, but long ago I had a .COM that did this:

    V1 = version # of "foo.bar;" (highest version)
    V2 = version # of "foo.bar;-0" (lowest version)
    total = V1-V2+1 (# of versions if no gaps)

    Repeat "total" times with I going from 1 to total, and J from V2 to V1:
    Rename ";J" to ";I"

    There was logic to deal with gaps (if something in the middle was
    deleted).

    Feel free to reinvent it from this.


  6. Re: File Version limit Reset

    Thanks very much to everyone who has responded and also those who
    posted procedures - you have all been very helpful !!


  7. Re: File Version limit Reset

    rexruger@gmail.com wrote:
    >
    > Hi,
    >
    > I was hoping someone may have already written a DCL procedure for this
    > problem. I have searched but could not find anything.
    >
    > I would like to reset the version number on a file once it reaches or
    > approaches 32767.
    >
    > e.g.
    >
    > If I had 3 files
    >
    > file.dat;32767
    > file.dat;32766
    > file.dat;32765
    >
    > I would like to run the procedure and set the version number on the
    > files as follows :
    >
    > file.dat;3
    > file.dat;2
    > file.dat;1
    >
    > Hoping someone may be able to help


    Well, the easiest would be two steps:

    $ rename file.dat;* *.tad
    $ rename file.tad;* *.dat

    Obviously, that makes many brash assumptions.

    --
    David J Dachtera
    dba DJE Systems
    http://www.djesys.com/

    Unofficial OpenVMS Marketing Home Page
    http://www.djesys.com/vms/market/

    Unofficial Affordable OpenVMS Home Page:
    http://www.djesys.com/vms/soho/

    Unofficial OpenVMS-IA32 Home Page:
    http://www.djesys.com/vms/ia32/

    Unofficial OpenVMS Hobbyist Support Page:
    http://www.djesys.com/vms/support/

+ Reply to Thread