Easy DCL question PURGE vs. DELETE - VMS

This is a discussion on Easy DCL question PURGE vs. DELETE - VMS ; Is there any difference between $ PURGE/BEFORE="TODAY-8-" FILE.DAT and $ DELETE/BEFORE="TODAY-8-" FILE.DAT;* other than that the PURGE will leave one file, while the DELETE may not?...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 31

Thread: Easy DCL question PURGE vs. DELETE

  1. Easy DCL question PURGE vs. DELETE


    Is there any difference between

    $ PURGE/BEFORE="TODAY-8-" FILE.DAT

    and

    $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*

    other than that the PURGE will leave one file,
    while the DELETE may not?


  2. Re: Easy DCL question PURGE vs. DELETE

    In article , norm.raphael@metso.com writes:
    >
    > Is there any difference between
    >
    > $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    >
    > and
    >
    > $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*
    >
    > other than that the PURGE will leave one file,
    > while the DELETE may not?


    Without checking your date specification, I would say rather

    PURGE will leave "at least" one file
    while DELETE may not.

  3. Re: Easy DCL question PURGE vs. DELETE

    norm.raphael@metso.com wrote:
    > Is there any difference between
    >
    > $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    > $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*



    Not entirely sure but:

    DELETE will definitely look at the date for each individual file prior
    to deleteing it.

    PURGE *may* look only at the highest version's date before deciding
    whether to do a purge on that file name. This means that if you have a
    recent log file, PURGE might skip it and not delete any of the versions
    below it that are old enough to match your criteria.

  4. Re: Easy DCL question PURGE vs. DELETE

    In article <39652$46b34e5d$cef8887a$22855@TEKSAVVY.COM>, JF Mezei writes:
    > norm.raphael@metso.com wrote:
    >> Is there any difference between
    >>
    >> $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    >> $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*

    >
    >
    > Not entirely sure but:
    >
    > DELETE will definitely look at the date for each individual file prior
    > to deleteing it.
    >
    > PURGE *may* look only at the highest version's date before deciding
    > whether to do a purge on that file name. This means that if you have a
    > recent log file, PURGE might skip it and not delete any of the versions
    > below it that are old enough to match your criteria.


    Testing shows this not to be the case. All versions are checked against
    the date specification.

    The behavior is consistent with an implementation strategy of:

    PURGE /KEEP=n:

    Check each matching file (with an implicit ;* on the file spec)
    If it's one of the highest n versions, skip it.
    If it doesn't match the date selection criterion, skip it
    Delete it.

    DELETE:

    Check each matching file (require an explicit version specification)
    If it doesn't match the date selection criterion, skip it
    Delete it

  5. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 1:12 pm, bri...@encompasserve.org wrote:
    > In article <39652$46b34e5d$cef8887a$22...@TEKSAVVY.COM>, JF Mezei writes:
    >
    > > norm.raph...@metso.com wrote:
    > >> Is there any difference between

    >
    > >> $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    > >> $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*

    >
    > > Not entirely sure but:

    >
    > > DELETE will definitely look at the date for each individual file prior
    > > to deleteing it.

    >
    > > PURGE *may* look only at the highest version's date before deciding
    > > whether to do a purge on that file name. This means that if you have a
    > > recent log file, PURGE might skip it and not delete any of the versions
    > > below it that are old enough to match your criteria.

    >
    > Testing shows this not to be the case. All versions are checked against
    > the date specification.
    >
    > The behavior is consistent with an implementation strategy of:
    >
    > PURGE /KEEP=n:
    >
    > Check each matching file (with an implicit ;* on the file spec)
    > If it's one of the highest n versions, skip it.
    > If it doesn't match the date selection criterion, skip it
    > Delete it.
    >
    > DELETE:
    >
    > Check each matching file (require an explicit version specification)
    > If it doesn't match the date selection criterion, skip it
    > Delete it


    Well, not quite:

    $ DIR BLAH.TMP

    Directory SYS$SYSDEVICE:[TEST]

    BLAH.TMP;9 0/0 3-AUG-2007
    13:22:20.13
    BLAH.TMP;8 0/0 3-AUG-2007
    13:22:18.54
    BLAH.TMP;7 0/0 3-AUG-2007
    13:22:16.95
    BLAH.TMP;6 0/0 3-AUG-2007
    13:22:15.35
    BLAH.TMP;5 0/0 3-AUG-2007
    13:22:13.68
    BLAH.TMP;4 0/0 3-AUG-2007
    13:22:12.01
    BLAH.TMP;3 0/0 3-AUG-2007
    13:22:10.33
    BLAH.TMP;2 0/0 3-AUG-2007
    13:22:08.54
    BLAH.TMP;1 0/0 3-AUG-2007
    13:22:06.90

    Total of 9 files, 0/0 blocks.
    $
    $ PURGE/KEEP=3/BEFORE=13:22:16 BLAH.TMP
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    %PURGE-I-TOTAL, 4 files deleted (0 blocks)
    $

    With /KEEP=1 it would have kept all the files created after the time,
    which would be ;9 through ;7. Since we specified two more than one it
    deletes two additional files: ;6 and ;5.

    $ DEL/BEFORE=13:22:16 BLAH.TMP;*
    %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;6 deleted (0 blocks)
    %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)
    %DELETE-I-TOTAL, 2 files deleted (0 blocks)

    (My PURG and DEL symbols include /LOG, of course.)

    AEF


  6. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 12:34 pm, AEF wrote:
    > On Aug 3, 1:12 pm, bri...@encompasserve.org wrote:
    >
    >
    >
    > > In article <39652$46b34e5d$cef8887a$22...@TEKSAVVY.COM>, JF Mezei writes:

    >
    > > > norm.raph...@metso.com wrote:
    > > >> Is there any difference between

    >
    > > >> $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    > > >> $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*

    >
    > > > Not entirely sure but:

    >
    > > > DELETE will definitely look at the date for each individual file prior
    > > > to deleteing it.

    >
    > > > PURGE *may* look only at the highest version's date before deciding
    > > > whether to do a purge on that file name. This means that if you have a
    > > > recent log file, PURGE might skip it and not delete any of the versions
    > > > below it that are old enough to match your criteria.

    >
    > > Testing shows this not to be the case. All versions are checked against
    > > the date specification.

    >
    > > The behavior is consistent with an implementation strategy of:

    >
    > > PURGE /KEEP=n:

    >
    > > Check each matching file (with an implicit ;* on the file spec)
    > > If it's one of the highest n versions, skip it.
    > > If it doesn't match the date selection criterion, skip it
    > > Delete it.

    >
    > > DELETE:

    >
    > > Check each matching file (require an explicit version specification)
    > > If it doesn't match the date selection criterion, skip it
    > > Delete it

    >
    > Well, not quite:
    >
    > $ DIR BLAH.TMP
    >
    > Directory SYS$SYSDEVICE:[TEST]
    >
    > BLAH.TMP;9 0/0 3-AUG-2007
    > 13:22:20.13
    > BLAH.TMP;8 0/0 3-AUG-2007
    > 13:22:18.54
    > BLAH.TMP;7 0/0 3-AUG-2007
    > 13:22:16.95
    > BLAH.TMP;6 0/0 3-AUG-2007
    > 13:22:15.35
    > BLAH.TMP;5 0/0 3-AUG-2007
    > 13:22:13.68
    > BLAH.TMP;4 0/0 3-AUG-2007
    > 13:22:12.01
    > BLAH.TMP;3 0/0 3-AUG-2007
    > 13:22:10.33
    > BLAH.TMP;2 0/0 3-AUG-2007
    > 13:22:08.54
    > BLAH.TMP;1 0/0 3-AUG-2007
    > 13:22:06.90
    >
    > Total of 9 files, 0/0 blocks.
    > $
    > $ PURGE/KEEP=3/BEFORE=13:22:16 BLAH.TMP
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    > %PURGE-I-TOTAL, 4 files deleted (0 blocks)
    > $
    >
    > With /KEEP=1 it would have kept all the files created after the time,
    > which would be ;9 through ;7. Since we specified two more than one it
    > deletes two additional files: ;6 and ;5.
    >
    > $ DEL/BEFORE=13:22:16 BLAH.TMP;*
    > %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;6 deleted (0 blocks)
    > %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)
    > %DELETE-I-TOTAL, 2 files deleted (0 blocks)
    >
    > (My PURG and DEL symbols include /LOG, of course.)
    >


    There was a discussion about PURGE's inconsistencies in ITRC not too
    long ago.

    <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    threadId=1093051>

    Don't know if they've been addressed yet or not.



  7. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 2:02 pm, Doug Phillips wrote:
    > On Aug 3, 12:34 pm, AEF wrote:
    >
    > There was a discussion about PURGE's inconsistencies in ITRC not too
    > long ago.
    >
    > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > threadId=1093051>
    >
    > Don't know if they've been addressed yet or not.


    Damned wrap: Here's a tiny url.




  8. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 3:02 pm, Doug Phillips wrote:
    > On Aug 3, 12:34 pm, AEF wrote:
    >
    > > On Aug 3, 1:12 pm, bri...@encompasserve.org wrote:

    >
    > > > In article <39652$46b34e5d$cef8887a$22...@TEKSAVVY.COM>, JF Mezei writes:

    >
    > > > > norm.raph...@metso.com wrote:
    > > > >> Is there any difference between

    >
    > > > >> $ PURGE/BEFORE="TODAY-8-" FILE.DAT
    > > > >> $ DELETE/BEFORE="TODAY-8-" FILE.DAT;*

    >
    > > > > Not entirely sure but:

    >
    > > > > DELETE will definitely look at the date for each individual file prior
    > > > > to deleteing it.

    >
    > > > > PURGE *may* look only at the highest version's date before deciding
    > > > > whether to do a purge on that file name. This means that if you have a
    > > > > recent log file, PURGE might skip it and not delete any of the versions
    > > > > below it that are old enough to match your criteria.

    >
    > > > Testing shows this not to be the case. All versions are checked against
    > > > the date specification.

    >
    > > > The behavior is consistent with an implementation strategy of:

    >
    > > > PURGE /KEEP=n:

    >
    > > > Check each matching file (with an implicit ;* on the file spec)
    > > > If it's one of the highest n versions, skip it.
    > > > If it doesn't match the date selection criterion, skip it
    > > > Delete it.

    >
    > > > DELETE:

    >
    > > > Check each matching file (require an explicit version specification)
    > > > If it doesn't match the date selection criterion, skip it
    > > > Delete it

    >
    > > Well, not quite:

    >
    > > $ DIR BLAH.TMP

    >
    > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > BLAH.TMP;9 0/0 3-AUG-2007
    > > 13:22:20.13
    > > BLAH.TMP;8 0/0 3-AUG-2007
    > > 13:22:18.54
    > > BLAH.TMP;7 0/0 3-AUG-2007
    > > 13:22:16.95
    > > BLAH.TMP;6 0/0 3-AUG-2007
    > > 13:22:15.35
    > > BLAH.TMP;5 0/0 3-AUG-2007
    > > 13:22:13.68
    > > BLAH.TMP;4 0/0 3-AUG-2007
    > > 13:22:12.01
    > > BLAH.TMP;3 0/0 3-AUG-2007
    > > 13:22:10.33
    > > BLAH.TMP;2 0/0 3-AUG-2007
    > > 13:22:08.54
    > > BLAH.TMP;1 0/0 3-AUG-2007
    > > 13:22:06.90

    >
    > > Total of 9 files, 0/0 blocks.
    > > $
    > > $ PURGE/KEEP=3/BEFORE=13:22:16 BLAH.TMP
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    > > %PURGE-I-TOTAL, 4 files deleted (0 blocks)
    > > $

    >
    > > With /KEEP=1 it would have kept all the files created after the time,
    > > which would be ;9 through ;7. Since we specified two more than one it
    > > deletes two additional files: ;6 and ;5.

    >
    > > $ DEL/BEFORE=13:22:16 BLAH.TMP;*
    > > %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;6 deleted (0 blocks)
    > > %DELETE-I-FILDEL, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)
    > > %DELETE-I-TOTAL, 2 files deleted (0 blocks)

    >
    > > (My PURG and DEL symbols include /LOG, of course.)

    >
    > There was a discussion about PURGE's inconsistencies in ITRC not too
    > long ago.
    >
    > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > threadId=1093051>
    >
    > Don't know if they've been addressed yet or not.


    I'll have to read that thread more carefully later. The fonts are not
    very readable for the DCL output.

    I don't think there's a bug. It's always worked as I have described
    AFAICT. I'll try on Decuserve later.

    AEF


  9. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 2:18 pm, AEF wrote:
    > On Aug 3, 3:02 pm, Doug Phillips wrote:
    >
    >
    >
    > > On Aug 3, 12:34 pm, AEF wrote:

    >
    > > > (My PURG and DEL symbols include /LOG, of course.)

    >
    > > There was a discussion about PURGE's inconsistencies in ITRC not too
    > > long ago.

    >
    > > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > > threadId=1093051>

    >
    > > Don't know if they've been addressed yet or not.

    >
    > I'll have to read that thread more carefully later. The fonts are not
    > very readable for the DCL output.
    >


    No comprende. You seem to be using:

    X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
    1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

    and the page is:



    It looks fine in my Firefox, even when I use IE Tab to switch the view
    to Internet Exposer. How are is the font displaying for you?


    > I don't think there's a bug. It's always worked as I have described.


    It's always (afaik) worked wrong (imo & that of a few notable others.)


  10. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 3:58 pm, Doug Phillips wrote:
    > On Aug 3, 2:18 pm, AEF wrote:
    >
    >
    >
    > > On Aug 3, 3:02 pm, Doug Phillips wrote:

    >
    > > > On Aug 3, 12:34 pm, AEF wrote:

    >
    > > > > (My PURG and DEL symbols include /LOG, of course.)

    >
    > > > There was a discussion about PURGE's inconsistencies in ITRC not too
    > > > long ago.

    >
    > > > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > > > threadId=1093051>

    >
    > > > Don't know if they've been addressed yet or not.

    >
    > > I'll have to read that thread more carefully later. The fonts are not
    > > very readable for the DCL output.

    >
    > No comprende. You seem to be using:
    >
    > X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
    > 1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
    >
    > and the page is:
    >
    >
    >
    > It looks fine in my Firefox, even when I use IE Tab to switch the view
    > to Internet Exposer. How are is the font displaying for you?
    >
    > > I don't think there's a bug. It's always worked as I have described.

    >
    > It's always (afaik) worked wrong (imo & that of a few notable others.)


    It "displays" correctly, but it's a hard-to-read font. All the DCL
    output has almost zero whitespace. I really prefer fixed-width font
    for DCL output. Proportional makes my head spin.

    How is it a bug?

    $ DIR/WID=FILE=15/NOSIZE

    Directory SYS$SYSDEVICE:[TEST]

    BLAH.TMP;9 3-AUG-2007 16:37:08.15
    BLAH.TMP;8 3-AUG-2007 16:37:07.53
    BLAH.TMP;7 3-AUG-2007 16:37:06.78
    BLAH.TMP;6 3-AUG-2007 16:37:06.07
    BLAH.TMP;5 3-AUG-2007 16:37:05.33
    BLAH.TMP;4 3-AUG-2007 16:37:04.50
    BLAH.TMP;3 3-AUG-2007 16:37:03.68
    BLAH.TMP;2 3-AUG-2007 16:37:02.80
    BLAH.TMP;1 3-AUG-2007 16:37:01.68

    Total of 9 files.
    $

    What would you expect for

    A $ PURGE BLAH.TMP /BEFORE=16:37:06
    B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    Since the default is /KEEP=1, I'd expect B to be the same as A

    For C, since 2 is one more than 1, I'd expect PURGE to keep one more
    file. This is in fact what happens:

    $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=3
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    %PURGE-I-TOTAL, 3 files deleted (0 blocks)

    $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)

    $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)

    $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06
    %PURGE-I-NOFILPURG, no files purged

    $

    How is this a bug?

    It's also consistent with the VMS philosophy of erring on the side of
    not deleting data. The proposed alternatives would often delete more
    files. For someone used to the current algorithm, that would be a
    surprise!

    AEF




  11. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 3:46 pm, AEF wrote:
    > On Aug 3, 3:58 pm, Doug Phillips wrote:
    >
    >
    >
    > > On Aug 3, 2:18 pm, AEF wrote:

    >
    > > > On Aug 3, 3:02 pm, Doug Phillips wrote:

    >
    > > > > On Aug 3, 12:34 pm, AEF wrote:

    >
    > > > > > (My PURG and DEL symbols include /LOG, of course.)

    >
    > > > > There was a discussion about PURGE's inconsistencies in ITRC not too
    > > > > long ago.

    >
    > > > > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > > > > threadId=1093051>

    >
    > > > > Don't know if they've been addressed yet or not.

    >
    > > > I'll have to read that thread more carefully later. The fonts are not
    > > > very readable for the DCL output.

    >
    > > No comprende. You seem to be using:

    >
    > > X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
    > > 1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

    >
    > > and the page is:

    >
    > >

    >
    > > It looks fine in my Firefox, even when I use IE Tab to switch the view
    > > to Internet Exposer. How are is the font displaying for you?

    >
    > > > I don't think there's a bug. It's always worked as I have described.

    >
    > > It's always (afaik) worked wrong (imo & that of a few notable others.)

    >
    > It "displays" correctly, but it's a hard-to-read font. All the DCL
    > output has almost zero whitespace. I really prefer fixed-width font
    > for DCL output. Proportional makes my head spin.
    >
    > How is it a bug?
    >
    > $ DIR/WID=FILE=15/NOSIZE
    >
    > Directory SYS$SYSDEVICE:[TEST]
    >
    > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > BLAH.TMP;1 3-AUG-2007 16:37:01.68
    >
    > Total of 9 files.
    > $
    >
    > What would you expect for
    >
    > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3
    >


    For each of those, I would expect that if I did

    $ DIR/BEFORE=16:37:06

    I would see the same files that PURGE would select for consideration;

    BLAH.TMP;5 3-AUG-2007 16:37:05.33
    BLAH.TMP;4 3-AUG-2007 16:37:04.50
    BLAH.TMP;3 3-AUG-2007 16:37:03.68
    BLAH.TMP;2 3-AUG-2007 16:37:02.80
    BLAH.TMP;1 3-AUG-2007 16:37:01.68


    For your example A & B, I would expect to end up with:

    BLAH.TMP;9 3-AUG-2007 16:37:08.15
    BLAH.TMP;8 3-AUG-2007 16:37:07.53
    BLAH.TMP;7 3-AUG-2007 16:37:06.78
    BLAH.TMP;6 3-AUG-2007 16:37:06.07
    BLAH.TMP;5 3-AUG-2007 16:37:05.33

    For C, I would expect to still have those, plus BLAH.TMP;4
    For D, I would expect to also still have BLAH.TMP;3

    I would expect that files ;8 and ;7 would be ignored because they are
    "AFTER" the date qualification.

    That's what the documentation says, and that's what help says, but
    that's not how it works.


    > Since the default is /KEEP=1, I'd expect B to be the same as A
    >
    > For C, since 2 is one more than 1, I'd expect PURGE to keep one more
    > file. This is in fact what happens:
    >
    > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=3
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    > %PURGE-I-TOTAL, 3 files deleted (0 blocks)
    >


    It should *not* have deleted BLAH.TMP;3 You told it to keep 3 files
    dated before 16:37:06 but it only kept 2.


    > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)
    >
    > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)
    >
    > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06
    > %PURGE-I-NOFILPURG, no files purged
    >
    > $
    >
    > How is this a bug?
    >


    It didn't keep the number of files you asked it to. How is this *not*
    a bug?

    > It's also consistent with the VMS philosophy of erring on the side of


    It does not work according to it's documentation, nor is it consistent
    with any other command's /before /since usage.

    As I quoted in the ITRC thread;

    Help /keep says: "Specifies the maximum number of versions of the
    __specified_ _files__ to be retained in the directory."
    (_emphasis mine)

    Help /before says:
    "Selects only those files dated prior to the specified time."

    The /before does not modify the /keep, it qualifies the files being
    selected; i.e. it defines the _specified_files_.


    > not deleting data. The proposed alternatives would often delete more
    > files. For someone used to the current algorithm, that would be a
    > surprise!



    The surprise is that this command is broken and has been for so long.

    This has been discussed in ITRC and I don't know why your browser is
    displaying the fonts wrong.


  12. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 4:49 pm, Doug Phillips wrote:
    > On Aug 3, 3:46 pm, AEF wrote:
    >

    [...]
    > > Directory SYS$SYSDEVICE:[TEST]
    > >
    > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    [...]
    > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    [...]
    > I would expect that files ;8 and ;7 would be ignored because they are
    > "AFTER" the date qualification.
    >


    That should have been files ;9, ;8, ;7 and ;6 would be ignored, of
    course.


  13. Re: Easy DCL question PURGE vs. DELETE

    On Aug 3, 5:49 pm, Doug Phillips wrote:
    > On Aug 3, 3:46 pm, AEF wrote:
    >
    > > On Aug 3, 3:58 pm, Doug Phillips wrote:

    >
    > > > On Aug 3, 2:18 pm, AEF wrote:

    >
    > > > > On Aug 3, 3:02 pm, Doug Phillips wrote:

    >
    > > > > > On Aug 3, 12:34 pm, AEF wrote:

    >
    > > > > > > (My PURG and DEL symbols include /LOG, of course.)

    >
    > > > > > There was a discussion about PURGE's inconsistencies in ITRC not too
    > > > > > long ago.

    >
    > > > > > <http://forums1.itrc.hp.com/service/f...tionanswer.do?
    > > > > > threadId=1093051>

    >
    > > > > > Don't know if they've been addressed yet or not.

    >
    > > > > I'll have to read that thread more carefully later. The fonts are not
    > > > > very readable for the DCL output.

    >
    > > > No comprende. You seem to be using:

    >
    > > > X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
    > > > 1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

    >
    > > > and the page is:

    >
    > > >

    >
    > > > It looks fine in my Firefox, even when I use IE Tab to switch the view
    > > > to Internet Exposer. How are is the font displaying for you?

    >
    > > > > I don't think there's a bug. It's always worked as I have described.

    >
    > > > It's always (afaik) worked wrong (imo & that of a few notable others.)

    >
    > > It "displays" correctly, but it's a hard-to-read font. All the DCL
    > > output has almost zero whitespace. I really prefer fixed-width font
    > > for DCL output. Proportional makes my head spin.

    >
    > > How is it a bug?

    >
    > > $ DIR/WID=FILE=15/NOSIZE

    >
    > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > Total of 9 files.
    > > $

    >
    > > What would you expect for

    >
    > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    >
    > For each of those, I would expect that if I did
    >
    > $ DIR/BEFORE=16:37:06
    >
    > I would see the same files that PURGE would select for consideration;
    >
    > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > BLAH.TMP;1 3-AUG-2007 16:37:01.68
    >
    > For your example A & B, I would expect to end up with:
    >
    > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > BLAH.TMP;5 3-AUG-2007 16:37:05.33


    Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
    not the highest version, I'd expect it to be deleted. Why would you
    expect ;5 to remain?

    Already we're in disagreement. OK.

    Definition: A file is an "old version" if it is not the current (or
    highest-numbered) version. In my example versions 1 through 8 would be
    all the "old versions" with 9 being the current version. I'm just
    trying to be sufficiently precise here.

    There are various ways to mix /KEEP and /BEFORE. One could apply /
    KEEP=n first, mark those n files as keepers, and then delete any
    others that are timestamped before the specified time t0. That's one
    way to do it -- method 1. OK. Method 2: The way you appear to favor is
    that we look at the files that are timestamped as being before time
    t0, and apply /KEEP=n solely within those. The third way is what VMS
    does -- method 3.

    There is the following disadvantage with your way: Suppose I want to
    delete all _old versions_ older than t0. How would I do it with your
    method? You'd have to specify PURGE/BEFORE=t0/KEEP=0. Now just what
    would /KEEP=0 mean without a time-based qualifier? Explicitly, what
    would PURGE/KEEP=0 mean? You'd have to special-case it and give a fun
    error message such as "0 invalid for /KEEP without /BEFORE". So you
    either lose the ability to do this or you have to special-case it and
    display an "interesting" error message. Also, your way amounts to two
    different definitions of "/KEEP=n": One meaning applying to all
    versions and the other applying only to _old versions_. And I would
    find it somewhat disconcerting to see /KEEP=0 in a command that by its
    very raison d'etre is supposed to always keep at least one version!

    The VMS way is the following: PURGE/BEFORE=t0 means to delete all _old
    versions_ that are before t0. Isn't that the most straightforward
    interpretation of that? Since /KEEP=1 is the default, the command
    PURGE/BEFORE=t0 is then equivalent to the command PURGE/BEFORE=t0/
    KEEP=1. That makes sense, right? Then higher values for /KEEP simply
    keep that many more versions. No inconsistent definitions of /KEEP=n,
    no special-casing /KEEP=0, no disconcerting variations such as PURGE/
    KEEP=0, and you can easily delete all _old versions_ older than t0
    without even having to _know_ about /KEEP.

    Another way to look at it: The current version is always exempt from
    deletion by the PURGE command. Right? So it can delete only _old
    versions_. Since /KEEP=1 is the default, this means that PURGE and
    PURGE/KEEP=1 are equivalent. Now we can add /BEFORE=t0 to qualify
    which of the _old versions_ we wish to delete and /KEEP=1 is already
    busy saving the current version, so if t0 is recent enough, all the
    _old versions_ will be deleted. That makes sense, right? Now, what to
    do with /KEEP=n? Well, keep n-1 more versions than we would with /
    KEEP=1.

    Yet another way to look at it: /KEEP=n means to keep the n-1 most
    current versions from the set of files that would be deleted
    otherwise. There: Very simple and concise!

    OK, you may not like it. But that is the algorithm VMS uses and it has
    its own logic and some advantages (as I described above).

    > For C, I would expect to still have those, plus BLAH.TMP;4
    > For D, I would expect to also still have BLAH.TMP;3
    >
    > I would expect that files ;8 and ;7 would be ignored because they are
    > "AFTER" the date qualification.
    >
    > That's what the documentation says, and that's what help says, but
    > that's not how it works.


    I comment on the documentation below.

    > > Since the default is /KEEP=1, I'd expect B to be the same as A

    >
    > > For C, since 2 is one more than 1, I'd expect PURGE to keep one more
    > > file. This is in fact what happens:

    >
    > > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=3
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;3 deleted (0 blocks)
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;2 deleted (0 blocks)
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;1 deleted (0 blocks)
    > > %PURGE-I-TOTAL, 3 files deleted (0 blocks)

    >
    > It should *not* have deleted BLAH.TMP;3 You told it to keep 3 files
    > dated before 16:37:06 but it only kept 2.


    Actually, it kept 6. There were 9 files originally, and 3 were
    deleted. So that leaves 6.

    > > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;4 deleted (0 blocks)

    >
    > > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > %PURGE-I-FILPURG, SYS$SYSDEVICE:[TEST]BLAH.TMP;5 deleted (0 blocks)

    >
    > > $ PURGE/LOG BLAH.TMP /BEFORE=16:37:06
    > > %PURGE-I-NOFILPURG, no files purged

    >
    > > $

    >
    > > How is this a bug?

    >
    > It didn't keep the number of files you asked it to. How is this *not*
    > a bug?


    Actually, it kept more. See above.

    > > It's also consistent with the VMS philosophy of erring on the side of

    >
    > It does not work according to it's documentation, nor is it consistent
    > with any other command's /before /since usage.


    OK. Let's look at the documentation:

    /KEEP=number-of-versions
    Specifies the maximum number of versions of the specified files to be
    retained in the directory. If you do not include the /KEEP qualifier,
    all but the highest numbered version of the specified files are
    deleted from the directory.

    What the hell is this supposed to mean? It doesn't make any sense! It
    is ambiguous at best. Suppose I told you to bring me a maximum of 3
    apples. You could bring any number from 0 to 3 and you've done as I've
    asked. So the documentation is messed up. Also, if you have 9 versions
    of a file, and you specify something like PURGE/KEEP=3/BEFORE=20-
    NOV-1858, PURGE is going to keep all 9 versions, right? Now nine is
    more than three, right? And if 3 is the maximum number of versions to
    keep, it kept more than three, right? Thus a contradiction even with
    your method! It is the doc's description of /KEEP that is definitely a
    "bug".

    Please notice that missing file-spec fields are not consistent in
    their behavior from one command to another. In some commands a
    particular missing field is a wildcard; in others, not. Sticky
    defaults are also inconsistent from one command to another. So you
    should be upset about these, too.

    More from the doc:

    Description

    The PURGE command deletes earlier versions of files. The PURGE
    command never deletes all versions of any file. By default, the PURGE
    command keeps only the highest version of a file. If you do not
    include a file specification with the PURGE command, all files in the
    current directory are affected by the purge.

    [Even this lacks the required precision. Earlier versions of a file? I
    could have the highest-numbered version older than the lower versions,
    right? So earlier has to be interpreted as "not current".]

    /BEFORE[=time]
    Selects only those files dated prior to the specified time. You can
    specify time as absolute time, as a combination of absolute and delta
    times, or as one of the following keywords: BOOT, LOGIN, TODAY
    (default), TOMORROW, or YESTERDAY. Specify one of the following
    qualifiers with the /BEFORE qualifier to indicate the time attribute
    to be used as the basis for selection: /BACKUP, /CREATED (default), /
    EXPIRED, or /MODIFIED.

    OK, so if I do PURGE/BEFORE=t0, then I'd expect all files dated before
    t0 to be deleted, except that the highest version is never deleted.

    Where from this does it say that the highest version of the versions
    dated before t0 will be kept? This is why I don't understand why you
    think BLAH.TMP;5 should be kept in case A. Method 3 is a natural
    generalization of this, or at least one possible generalization.

    > As I quoted in the ITRC thread;
    >
    > Help /keep says: "Specifies the maximum number of versions of the
    > __specified_ _files__ to be retained in the directory."
    > (_emphasis mine)


    This is ambiguous at best. It is not specific enough to determine what
    to do. It needs to be rewritten from scratch. Even "specified files"
    is ambiguous. You can have 'file' meaning as it would in saying there
    are many versions of a 'file' (note, file is singular here) or you
    could have it mean that each version of the 'file' is a 'file'. I
    favor the former because the PURGE command deletes old versions of a
    file. It doesn't delete old versions of old versions. You specify the
    files to be purged in the parameter. Note that you can't include a
    version number in the parameter. [I'd continue here but this is
    degenerating into semantics hell.]

    Actually, upon rereading the /KEEP description I think the former
    makes more sense. You can't have more than one version of a version!
    Each version is its own version! So if you insist on it meaning the
    latter, you get "Specifies the maximum number of versions of the
    specified versions to be retained in the directory". Well, I suppose
    you can draw the following parallel: Specifies the maximum number of
    apples of the specified apples to be retained in the basket. Yeah, I
    suppose it makes sense that way, too. But my main point is that it is
    ambiguous.

    > Help /before says:
    > "Selects only those files dated prior to the specified time."


    And so it does. Can you show me an example where PURGE/BEFORE=t0
    deletes files that are dated before t0? And wouldn't this mean to
    delete BLAH.TMP;5 in case A (as long as it is not the highest version
    number, of course)?

    Note also that the /BEFORE qualifier doesn't specify, it selects! (If
    you're going to point out specifies and selects, than I can say this.)

    Note that you PURGE a file meaning a name.typ !. You DELETE a version,
    meaning a name.typ;n.

    > The /before does not modify the /keep, it qualifies the files being
    > selected; i.e. it defines the _specified_files_.


    That's one possible interpretation, but not the only one. VMS
    interprets /KEEP=n as to keep the most current n-1 more files that
    wouldn't have been deleted otherwise. Suppose you do /KEEP=n/BEFORE=t0
    instead of /BEFORE=t0/KEEP=n? In this case, /KEEP comes before /
    BEFORE. My point here is that I don't see why you insist that one
    possible order is the only or "right" way. Of course the order of the
    qualifiers here doesn't matter to VMS, which only further supports my
    point.

    > > not deleting data. The proposed alternatives would often delete more
    > > files. For someone used to the current algorithm, that would be a
    > > surprise!


    Oops. I was wrong here. ... Never mind.

    >
    > The surprise is that this command is broken and has been for so long.


    It depends on which algorithm you prefer. If you were writing the
    code, would you add /KEEP=0 and how would you special-case it for
    when /BEFORE is not specified? When you actually write the code it can
    give you more insight into the problem because it forces you to fully
    think through the problem. So I usually start, at least, by assuming
    the code is correct, unless there's some blatant flaw. (OK, you may
    think this is an obvious flaw, so it's subjective. But if I run
    DIRECTORY and it deletes files -- that's what I'm talking about for a
    blatant flaw.)

    You can gripe about _something_ with all 3 methods. But with method 3
    (VMS), you can easily do a particular task that you cannot do with
    method 2 (yours). And you can simply add 1 to the number you give to /
    KEEP to do what you want. So the VMS method is the most versatile and
    doesn't require knowing about /KEEP to use /BEFORE.

    So, in summary, the VMS developers chose PURG/BEFORE=t0 to delete all
    _old versions_ of file whose time stamp is before t0. Then they
    decided that /KEEP=1 is the default /KEEP behavior, and that /KEEP=n
    would keep n-1 more files than that, always choosing the highest-
    version numbers to keep.

    Note that if the files are not always in descending chronological
    order! If they are in reverse order, this entire discussion applies
    to /SINCE instead of /BEFORE. If they are in mixed order, then PURGE/
    BEFORE or PURGE/SINCE will delete all _old versions_ meeting its spec
    and adding /KEEP=n to that will cause it to keep n-1 more highest
    versions.

    > This has been discussed in ITRC and I don't know why your browser is
    > displaying the fonts wrong.


    Well, I think the correct text is displayed. But there isn't enough
    whitespace in the DCL output examples and none of it is in fixed-width
    fonts. I mean I can read it, but it is a struggle compared to what it
    should be. It's a little like trying to read SHUTDOWN.COM,
    AUTOGEN.COM, or VMSINSTAL.COM. It's as if it had been run through
    DCL_DIET, but not quite as bad. Everything is there correctly, but
    it's much harder to read than it should be. Moreover, computer output
    should be in fixed-width fonts, period.

    And NO, I am not going to go through fix-the-font hell in either IE or
    Firefox. Both suck in this respect, at least when I tried a few years
    ago, mostly to fix how Google Groups displayed posts and to improve
    the appearance of www.wundergound.com on Firefox. And Firefox was
    worse! It's still bizarre. Look at it! What a mess! Trying to fix
    fonts in a either of these browsers is a super PITA!!!

    NO! I won't do it. I'm passing on fix-the-font hell. You're welcome to
    stop by and fix it for me, however. :-)

    AEF


  14. Re: Easy DCL question PURGE vs. DELETE

    *Sorry if this posts twice; Google told me that it posted
    successfully, then told me it hadn't yet posted when I tried to leave
    the page:-( a Google-Gurgle? )

    On Aug 4, 8:50 am, AEF wrote:
    > On Aug 3, 5:49 pm, Doug Phillips wrote:
    >
    > > On Aug 3, 3:46 pm, AEF wrote:

    >

    [...]
    >
    > > > How is it a bug?

    >
    > > > $ DIR/WID=FILE=15/NOSIZE

    >
    > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > Total of 9 files.
    > > > $

    >
    > > > What would you expect for

    >
    > > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    >
    > > For each of those, I would expect that if I did

    >
    > > $ DIR/BEFORE=16:37:06

    >
    > > I would see the same files that PURGE would select for consideration;

    >
    > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > For your example A & B, I would expect to end up with:

    >
    > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > BLAH.TMP;5 3-AUG-2007 16:37:05.33

    >
    > Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
    > not the highest version, I'd expect it to be deleted. Why would you
    > expect ;5 to remain?
    >


    Because the command is PURGE, *not* DELETE. Purge is supposed to keep
    the highest (to a maximum of the specified number of) version(s) of
    the *specified* files if any files match the selection criteria. The
    default is the _specified_file(s)_ with the highest version number(s).
    If you want to DELETE the files, then use DELETE. PURGE is *not*
    DELETE.

    > Already we're in disagreement. OK.
    >


    How unusual;-)

    There's no way I'm going to quote your entire novella of a post(;-))),
    but I'll try to address some of your confusion. You might have to go
    back and reread your own post to understand some of the points I'm
    addressing.


    > There are various ways to mix /KEEP and /BEFORE. One could apply /
    > KEEP=n first, mark those n files as keepers, and then delete any
    > others that are timestamped before the specified time t0. That's one
    > way to do it -- method 1. OK. Method 2: The way you appear to favor is
    > that we look at the files that are timestamped as being before time
    > t0, and apply /KEEP=n solely within those. The third way is what VMS
    > does -- method 3.
    >


    There is no "my way". There is no "mix" of /KEEP and /BEFORE. These
    PURGE qualifiers are precisely explained in the HELP and the Doc's.
    You are fighting those definitions trying to find an explanation that
    fits how the command malfunctions. You are trying to apply the logic
    of the DELETE command to PURGE. PURGE is not DELETE!

    The /BEFORE qualifier is a FILE SELECTOR. It says select files dated
    before this date. That's the way /BEFORE works in this command and all
    of the other DCL commands where it's used. That is as simple as it
    gets.

    The /KEEP says how many of the SELECTED files should be kept if more
    than that number exist. The default is one. Purge removes any files
    with version numbers lower than the files you tell it to keep (by spec
    or default, always at least one if at least one file is selected.) It
    says *nothing* about how many files should be purged (deleted, if you
    prefer.) It says how many should be *kept*. That's also as simple as
    it gets. PURGE, by definition, should *always* keep at least ONE of
    the files selected by the file spec and all other file selection
    qualifiers that you provide, if any exist, and it should keep the
    number of files you specify if that many exist. /KEEP means keep, not
    delete.

    There should be no way for purge to delete every *selected* file.
    That's what DELETE is for, and because DELETE can remove all versions
    of files, it requires a more precise file spec. Again, PURGE is not
    DELETE.

    I guess I can only keep repeating what the documentation says, because
    that's the way it *should* work. But, that's not the way it works.

    In reading everything you've written, I see you struggling. Your
    attempted "simplifications" show you are fighting the fact that the
    way PURGE works is not the way it was intended to work. PURGE is *NOT*
    DELETE. If you read the HELP and the doc's again, keeping that fact in
    mind, I think you'll see that the explanations are clear and precise.

    In the ITRC discussion, Jon Pinkley demonstrated that the bug is not
    limited to the /BEFORE qualifier. I hope he doesn't mind if I quote
    some of his post here:

    ################################################## ######

    [...]
    This discussion has convinced me that the behavior should be as you
    describe, since the "selected files" should be the set of files
    selected by the filespec and the qualifiers. The bug in purge is not
    limited to /before as is demonstrated by the following:

    $ show system/noproc ! not portable ...
    OpenVMS V8.3 on node SIGMA 23-FEB-2007 22:23:30.28 Uptime 1 00:56:43
    $ analyze/image/select=(id,link) sys$system:delete.exe; ! not portable
    SYS$COMMON:[SYSEXE]DELETE.EXE;1
    "X-05"
    29-JUN-2006 18:18:42.45
    $ directory/own/date=(cre,mod) pt.tmp;*

    Directory SYS$SYSROOT:[SYSMGR]

    PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    PT.TMP;3 3-JAN-2000 01:00:30.88 3-JAN-2000 01:01:30.88 [1,1]
    PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    Total of 5 files.
    $ purge/keep=2/by_own=[1,1]/log pt.tmp
    %PURGE-I-FILPURG, SYS$SYSROOT:[SYSMGR]PT.TMP;3 deleted (0 blocks)
    $ directory/own/date=(cre,mod) pt.tmp;*

    Directory SYS$SYSROOT:[SYSMGR]

    PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    Total of 4 files.

    I have tested this on 7.2-2, 7.3-2 and 8.3, they all show this
    behavior. Including reproducer as attachment.

    I think I have narrowed the conditions necessary to exhibit bug.

    Some definitions:

    Selection set: The set of files that meet the filespec and qualifiers.

    Statement of problem:

    If the highest version of a specific device:[directory]file.type is
    not a member of the selection set, and /keep versions > 1, then one
    less file is kept than specified by the /keep qualifier.

    Expected cause: from source listings: [V732.DELETE.LIS]PURGE.LIS
    (which was more handy than 8.3)

    In routine purge_ods2_files, at line 931 there is a check for a change
    in device, directory, name or type. If there is change, then in line
    936 the versions (matching purge selection) is unconditionally set to
    1, i.e. no check is made to see if this meets the requirements of the
    common qualifiers. If it isn't the highest version, then the routine
    purge_this_file is called. purge_this_file calls DEL$MATCH_FILENAME
    which checks if the file matches the selection criteria, and if so
    increments the versions seen, and if gtr than the specified /keep
    versions, deletes the file.
    [...]

    ################################################## ##

    I believe this was formally reported to HP. I do not know its current
    status.


  15. Re: Easy DCL question PURGE vs. DELETE

    On Aug 4, 12:55 pm, Doug Phillips wrote:
    > *Sorry if this posts twice; Google told me that it posted
    > successfully, then told me it hadn't yet posted when I tried to leave
    > the page:-( a Google-Gurgle? )
    >
    > On Aug 4, 8:50 am, AEF wrote:
    >
    > > On Aug 3, 5:49 pm, Doug Phillips wrote:

    >
    > > > On Aug 3, 3:46 pm, AEF wrote:

    >
    > [...]
    >
    > > > > How is it a bug?

    >
    > > > > $ DIR/WID=FILE=15/NOSIZE

    >
    > > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > > Total of 9 files.
    > > > > $

    >
    > > > > What would you expect for

    >
    > > > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    >
    > > > For each of those, I would expect that if I did

    >
    > > > $ DIR/BEFORE=16:37:06

    >
    > > > I would see the same files that PURGE would select for consideration;

    >
    > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > For your example A & B, I would expect to end up with:

    >
    > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33

    >
    > > Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
    > > not the highest version, I'd expect it to be deleted. Why would you
    > > expect ;5 to remain?

    >
    > Because the command is PURGE, *not* DELETE. Purge is supposed to keep
    > the highest (to a maximum of the specified number of) version(s) of
    > the *specified* files if any files match the selection criteria. The
    > default is the _specified_file(s)_ with the highest version number(s).
    > If you want to DELETE the files, then use DELETE. PURGE is *not*
    > DELETE.


    I can see it both ways. The advantage of the current way is that you
    can delete all files older than a certain time except that the current
    version is always kept. How would you do this with your desired
    algorithm?

    To be more explicit, let's use the example above. Suppose I want to
    get rid of all files older than 16:37:07, except to not delete the
    current version even if it too is older. I can do

    $ PURGE BLAH.TMP /BEFORE=16:37:07

    and versions 7 thru 5 will be deleted. You can't do that with your
    desired algorithm. You can counter by saying, well you should use
    DELETE. Well I can counter by saying suppose I want to do the same
    command except using the time 17:00 but be sure the current version is
    unconditionally not deleted:

    $ PURGE BLAH.TMP /BEFORE=17

    Now, all versions satisfy the criterion but the first one is kept.
    This way I can freely construct commands like this and be sure that I
    always leave the current version intact. There is no way to do this
    with the algorithm you prefer without an unreaonable amount of pain.
    If you don't like the current algorithm you can always just add one to
    the number you would otherwise supply to the /KEEP qualifier. But if
    your algorithm is implemented there is not way, short of writing a
    multi-line DCL procedure (or a painful /EXCLUDE qualifier), to do what
    I want as described just above.

    Why would I want this? To protect my self from user error. Using
    DELETE is riskier. With PURGE I can be assured that I won't
    inadvertently delete all versions of a file.

    I see it this way:

    $ PURGE ! Delete all but the current version

    $ PURGE/BEFORE=time ! Consider the same versions for deletion as in
    PURGE, but delete only the versions that meet the /BEFORE=time
    criterion.

    > > Already we're in disagreement. OK.

    >
    > How unusual;-)
    >
    > There's no way I'm going to quote your entire novella of a post(;-))),
    > but I'll try to address some of your confusion. You might have to go
    > back and reread your own post to understand some of the points I'm
    > addressing.
    >
    > > There are various ways to mix /KEEP and /BEFORE. One could apply /
    > > KEEP=n first, mark those n files as keepers, and then delete any
    > > others that are timestamped before the specified time t0. That's one
    > > way to do it -- method 1. OK. Method 2: The way you appear to favor is
    > > that we look at the files that are timestamped as being before time
    > > t0, and apply /KEEP=n solely within those. The third way is what VMS
    > > does -- method 3.

    >
    > There is no "my way". There is no "mix" of /KEEP and /BEFORE. These
    > PURGE qualifiers are precisely explained in the HELP and the Doc's.
    > You are fighting those definitions trying to find an explanation that
    > fits how the command malfunctions. You are trying to apply the logic
    > of the DELETE command to PURGE. PURGE is not DELETE!


    The doc is ambigiuous for /KEEP. I already proved this.

    > The /BEFORE qualifier is a FILE SELECTOR. It says select files dated
    > before this date. That's the way /BEFORE works in this command and all
    > of the other DCL commands where it's used. That is as simple as it
    > gets.


    It depends on what you mean by "file". I can have multiple versions of
    one file. That use of file means one file. But each version is itself
    a "file", but in another sense, which then means multiple files.
    Besides, /BEFORE "selects" which versions can be deleted. The
    parameter "specifies" which files are to be PURGEd.

    > The /KEEP says how many of the SELECTED files should be kept if more
    > than that number exist. The default is one.


    That's not what the doc says. The doc says this:

    /KEEP=number-of-versions
    Specifies the maximum number of versions of the specified files to be
    retained in the directory. If you do not include the /KEEP qualifier,
    all but the highest numbered version of the specified files are
    deleted from the directory.

    It's too vague to be of any use. Besides, you specify with the
    parameter. The qualifiers select, not specify.

    Without other qualifiers, this is what /KEEP=n means as I see it: Put
    the n highest versions on an exclude list. Delete the others. If there
    are fewer than n versions, do nothing.

    That's not the same.

    > Purge removes any files
    > with version numbers lower than the files you tell it to keep (by spec
    > or default, always at least one if at least one file is selected.) It
    > says *nothing* about how many files should be purged (deleted, if you
    > prefer.) It says how many should be *kept*. That's also as simple as
    > it gets. PURGE, by definition, should *always* keep at least ONE of
    > the files selected by the file spec


    It's specified, not selected.

    > and all other file selection
    > qualifiers that you provide, if any exist, and it should keep the
    > number of files you specify if that many exist. /KEEP means keep, not
    > delete.


    And here we disagree. And we will always disagree on this.

    So use /KEEP=2 and you'll get what you want. If the algorithm of PURGE
    is changed to what you want it to be then I won't be able to do what I
    want without writing a multiline DCL procedure.

    > There should be no way for purge to delete every *selected* file.
    > That's what DELETE is for, and because DELETE can remove all versions
    > of files, it requires a more precise file spec. Again, PURGE is not
    > DELETE.


    But commands like DELETE/BEFORE='time' risk the deletion of all
    versions of a file. So I can't use DELETE without having to look at
    the version number(s) I wish to keep and putting it(them) in the
    exclude qualifier, which would only work if only one file is
    specified. If multiple files are specified then I don't think you
    could do it even with /EXCLUDE without explicitly typing out the full
    name, type, and version number of each and every version I want to
    keep (because there's no sticky-default action with /EXCLUDE!). What a
    pain! It's much easier to use /KEEP=2 if you want to do it your way.

    >
    > I guess I can only keep repeating what the documentation says, because
    > that's the way it *should* work. But, that's not the way it works.
    >
    > In reading everything you've written, I see you struggling. Your
    > attempted "simplifications" show you are fighting the fact that the
    > way PURGE works is not the way it was intended to work. PURGE is *NOT*
    > DELETE. If you read the HELP and the doc's again, keeping that fact in
    > mind, I think you'll see that the explanations are clear and precise.


    I'm struggling because I find it difficult to put my thoughts into
    words. And I'm trying to be precise and explicit because words such as
    earlier, older, file, version, etc. are not precise enough. I'm also
    hoping that some variation of my explanation will make my point of
    view clear to you.

    No, the doc is not clear and precise. If I just told you to get me a
    maximum of three apples, how many will you bring? That's precise? "Oh,
    get me anywhere from zero to three apples, okay?" That's what the
    description of /KEEP is saying.

    >
    > In the ITRC discussion, Jon Pinkley demonstrated that the bug is not
    > limited to the /BEFORE qualifier. I hope he doesn't mind if I quote
    > some of his post here:
    >
    > ################################################## ######
    >
    > [...]
    > This discussion has convinced me that the behavior should be as you
    > describe, since the "selected files" should be the set of files
    > selected by the filespec and the qualifiers. The bug in purge is not
    > limited to /before as is demonstrated by the following:
    >
    > $ show system/noproc ! not portable ...
    > OpenVMS V8.3 on node SIGMA 23-FEB-2007 22:23:30.28 Uptime 1 00:56:43
    > $ analyze/image/select=(id,link) sys$system:delete.exe; ! not portable
    > SYS$COMMON:[SYSEXE]DELETE.EXE;1
    > "X-05"
    > 29-JUN-2006 18:18:42.45
    > $ directory/own/date=(cre,mod) pt.tmp;*
    >
    > Directory SYS$SYSROOT:[SYSMGR]
    >
    > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > PT.TMP;3 3-JAN-2000 01:00:30.88 3-JAN-2000 01:01:30.88 [1,1]
    > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]
    >
    > Total of 5 files.
    > $ purge/keep=2/by_own=[1,1]/log pt.tmp
    > %PURGE-I-FILPURG, SYS$SYSROOT:[SYSMGR]PT.TMP;3 deleted (0 blocks)
    > $ directory/own/date=(cre,mod) pt.tmp;*
    >
    > Directory SYS$SYSROOT:[SYSMGR]
    >
    > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]
    >
    > Total of 4 files.


    See? There's too little whitespace. It clutters the visual field of
    the mind and makes concentrating all that more difficult. Highly
    unreadable. You may as well try reading AUTOGEN.COM or STARTUP.COM. To
    repeat the previous sentence in ITRC format:
    YoumayaswelltryreadingAUTOGEN.COMorSTARTUP.COM. ;-) At least here it's
    in a fixed-width font (I'm writing this reply in Wordpad and will
    paste it into the Google Groups too-small input window.) And why both
    the creation and modification dates? Ugh.

    > I have tested this on 7.2-2, 7.3-2 and 8.3, they all show this
    > behavior. Including reproducer as attachment.
    >
    > I think I have narrowed the conditions necessary to exhibit bug.
    >
    > Some definitions:
    >
    > Selection set: The set of files that meet the filespec and qualifiers.
    >
    > Statement of problem:
    >
    > If the highest version of a specific device:[directory]file.type is
    > not a member of the selection set, and /keep versions > 1, then one
    > less file is kept than specified by the /keep qualifier.
    >
    > Expected cause: from source listings: [V732.DELETE.LIS]PURGE.LIS
    > (which was more handy than 8.3)
    >
    > In routine purge_ods2_files, at line 931 there is a check for a change
    > in device, directory, name or type. If there is change, then in line
    > 936 the versions (matching purge selection) is unconditionally set to
    > 1, i.e. no check is made to see if this meets the requirements of the
    > common qualifiers. If it isn't the highest version, then the routine
    > purge_this_file is called. purge_this_file calls DEL$MATCH_FILENAME
    > which checks if the file matches the selection criteria, and if so
    > increments the versions seen, and if gtr than the specified /keep
    > versions, deletes the file.
    > [...]
    >
    > ################################################## ##
    >
    > I believe this was formally reported to HP. I do not know its current
    > status.


    Same thing, different color. All the same arguments apply. If you
    don't like it use /KEEP=2.

    If you respond, please address my arguments instead of repeating
    yours. I tried to repeat only the portions of my post you didn't
    address. OK, maybe I'm just as guilty.

    I said I can see it both ways. I prefer "my way" and you prefer "your
    way". When done my way, you need only add 1 to whatever you supply to
    the /KEEP qualifier when using other qualifiers. With your way I have
    to go through a lot of pain to delete all versions that match the
    selection qualifiers except to keep the current version
    unconditionally. Why do you want to make it so painful for me?

    AEF


  16. Re: Easy DCL question PURGE vs. DELETE

    Sorry again, but this time for the length of the post.

    On Aug 4, 12:58 pm, AEF wrote:
    > On Aug 4, 12:55 pm, Doug Phillips wrote:
    >
    > > On Aug 4, 8:50 am, AEF wrote:

    >
    > > > On Aug 3, 5:49 pm, Doug Phillips wrote:

    >
    > > > > On Aug 3, 3:46 pm, AEF wrote:

    >
    > > [...]

    >
    > > > > > How is it a bug?

    >
    > > > > > $ DIR/WID=FILE=15/NOSIZE

    >
    > > > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > > > Total of 9 files.
    > > > > > $

    >
    > > > > > What would you expect for

    >
    > > > > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > > > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > > > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > > > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    >
    > > > > For each of those, I would expect that if I did

    >
    > > > > $ DIR/BEFORE=16:37:06

    >
    > > > > I would see the same files that PURGE would select for consideration;

    >
    > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > > For your example A & B, I would expect to end up with:

    >
    > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33

    >
    > > > Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
    > > > not the highest version, I'd expect it to be deleted. Why would you
    > > > expect ;5 to remain?

    >
    > > Because the command is PURGE, *not* DELETE. Purge is supposed to keep
    > > the highest (to a maximum of the specified number of) version(s) of
    > > the *specified* files if any files match the selection criteria. The
    > > default is the _specified_file(s)_ with the highest version number(s).
    > > If you want to DELETE the files, then use DELETE. PURGE is *not*
    > > DELETE.

    >
    > I can see it both ways. The advantage of the current way is that you
    > can delete all files older than a certain time except that the current
    > version is always kept. How would you do this with your desired
    > algorithm?
    >


    There is *no* advantage to the current action of /keep. It does *not*
    do what you describe above, as has been demonstrated here and
    elsewhere --- unless you're allowing the definition of "current
    version" to fall outside of the list of files that should be selected
    by the filespec and its qualifiers.

    > To be more explicit, let's use the example above. Suppose I want to
    > get rid of all files older than 16:37:07, except to not delete the
    > current version even if it too is older. I can do
    >


    Which do you consider the "current version"??

    > $ PURGE BLAH.TMP /BEFORE=16:37:07
    >


    By your command, purge should *ignore* all files named BLAH.TMP that
    are dated *on or since* 16:37:07, as well as all files with any other
    name that might reside within the current directory. So BLAH.TMP;9 and
    BLAH.TMP;8 should be completely ignored --- just as a file named
    BLAH.BLAH and all other files not matching your request should be
    ignored.

    That means you are selecting these files for purge to process:

    BLAH.TMP;7 3-AUG-2007 16:37:06.78
    BLAH.TMP;6 3-AUG-2007 16:37:06.07
    BLAH.TMP;5 3-AUG-2007 16:37:05.33
    BLAH.TMP;4 3-AUG-2007 16:37:04.50
    BLAH.TMP;3 3-AUG-2007 16:37:03.68
    BLAH.TMP;2 3-AUG-2007 16:37:02.80
    BLAH.TMP;1 3-AUG-2007 16:37:01.68

    By your command, purge should keep the highest version of the selected
    files, and purge the rest.

    That leaves BLAH.TMP;7 as the only remaining file that matches your
    specification.

    If you do a DIR BLAH.TMP after the purge, you should see:

    BLAH.TMP;9 3-AUG-2007 16:37:08.15
    BLAH.TMP;8 3-AUG-2007 16:37:07.53
    BLAH.TMP;7 3-AUG-2007 16:37:06.78

    That is, two files that you didn't specify in your purge command, and
    the "most current" version of the one you did.

    If you want purge to delete files that don't match your specs &
    qualifiers, then that's beyond my understanding.

    >
    > and versions 7 thru 5 will be deleted. You can't do that with your
    > desired algorithm. You can counter by saying, well you should use
    > DELETE.


    I will! If you want to DELETE files, use the DELETE command. If you
    want to PURGE files, use the PURGE command. THEY ARE NOT THE SAME
    COMMAND. (excuse me, I'll try to use my indoor voice from now on

    > Well I can counter by saying suppose I want to do the same
    > command except using the time 17:00 but be sure the current version is
    > unconditionally not deleted:
    >
    > $ PURGE BLAH.TMP /BEFORE=17
    >
    > Now, all versions satisfy the criterion but the first one is kept.
    > This way I can freely construct commands like this and be sure that I
    > always leave the current version intact. There is no way to do this
    > with the algorithm you prefer without an unreaonable amount of pain.



    That would work the same as if you didn't use the /before. All
    existing BLAH.TMP files match your request, so all except the highest
    will be purged. What are you asking?


    > If you don't like the current algorithm you can always just add one to
    > the number you would otherwise supply to the /KEEP qualifier. But if
    > your algorithm is implemented there is not way, short of writing a
    > multi-line DCL procedure (or a painful /EXCLUDE qualifier), to do what
    > I want as described just above.
    >


    You'd really accept that? "HELP PURGE /KEEP --- To keep 3 versions of
    a file, specify /KEEP=4" ?? Sorry, there's something about that that
    just seems wrong.

    > Why would I want this? To protect my self from user error. Using
    > DELETE is riskier. With PURGE I can be assured that I won't
    > inadvertently delete all versions of a file.
    >


    Exactly.

    > I see it this way:
    >
    > $ PURGE ! Delete all but the current version
    >


    [of each unique filename.ext in the current directory] Right

    > $ PURGE/BEFORE=time ! Consider the same versions for deletion as in
    > PURGE, but delete only the versions that meet the /BEFORE=time
    > criterion.


    Wrong. It should consider only the files that the command specifies:
    those dated /before=time. It should ignore *all* other files
    regardless of their name, version, age, color, religion, creed,
    national origin,....(sorry, mind wandered there for a bit.) You are
    wanting PURGE to act like DELETE --- and, btw, DELETE, DIR, COPY,
    BACKUP, RENAME,... only consider the files you specify, and I wouldn't
    want it any other way.

    >
    > > > Already we're in disagreement. OK.

    >
    > > How unusual;-)

    >
    > > There's no way I'm going to quote your entire novella of a post(;-))),
    > > but I'll try to address some of your confusion. You might have to go
    > > back and reread your own post to understand some of the points I'm
    > > addressing.

    >
    > > > There are various ways to mix /KEEP and /BEFORE. One could apply /
    > > > KEEP=n first, mark those n files as keepers, and then delete any
    > > > others that are timestamped before the specified time t0. That's one
    > > > way to do it -- method 1. OK. Method 2: The way you appear to favor is
    > > > that we look at the files that are timestamped as being before time
    > > > t0, and apply /KEEP=n solely within those. The third way is what VMS
    > > > does -- method 3.

    >
    > > There is no "my way". There is no "mix" of /KEEP and /BEFORE. These
    > > PURGE qualifiers are precisely explained in the HELP and the Doc's.
    > > You are fighting those definitions trying to find an explanation that
    > > fits how the command malfunctions. You are trying to apply the logic
    > > of the DELETE command to PURGE. PURGE is not DELETE!

    >
    > The doc is ambigiuous for /KEEP. I already proved this.


    I don't think the doc is ambiguous, and I don't find any "proof" in
    your statements.

    >
    > > The /BEFORE qualifier is a FILE SELECTOR. It says select files dated
    > > before this date. That's the way /BEFORE works in this command and all
    > > of the other DCL commands where it's used. That is as simple as it
    > > gets.

    >
    > It depends on what you mean by "file".


    Okay, Bill Clinton;-)


    > I can have multiple versions of
    > one file. That use of file means one file. But each version is itself
    > a "file", but in another sense, which then means multiple files.
    > Besides, /BEFORE "selects" which versions can be deleted. The
    > parameter "specifies" which files are to be PURGEd.
    >


    No. The parameter specifies which files should be considered by the
    purge command. Anywhere from zero to many files might be actually
    purged.
    Put a * or % wild-card in the file spec someplace and think about how
    that fits what you say.

    > > The /KEEP says how many of the SELECTED files should be kept if more
    > > than that number exist. The default is one.

    >
    > That's not what the doc says. The doc says this:
    >
    > /KEEP=number-of-versions
    > Specifies the maximum number of versions of the specified files to be
    > retained in the directory. If you do not include the /KEEP qualifier,
    > all but the highest numbered version of the specified files are
    > deleted from the directory.
    >


    Other than the word count and perspective (selected vs specified) how
    does what I said contradict the doc?

    It the perspective? Here: the purge command should "select" only the
    files that you "specify." Clearer?

    > It's too vague to be of any use. Besides, you specify with the
    > parameter. The qualifiers select, not specify.
    >


    To me, it reads clear and precise. I think you're just refusing to
    accept it.

    > Without other qualifiers, this is what /KEEP=n means as I see it: Put
    > the n highest versions on an exclude list. Delete the others. If there
    > are fewer than n versions, do nothing.
    >
    > That's not the same.
    >


    Well, it looks like the same meaning, just worded differently. Your
    "exclude" list, I would think of more as a count of matching files.

    > > Purge removes any files
    > > with version numbers lower than the files you tell it to keep (by spec
    > > or default, always at least one if at least one file is selected.) It
    > > says *nothing* about how many files should be purged (deleted, if you
    > > prefer.) It says how many should be *kept*. That's also as simple as
    > > it gets. PURGE, by definition, should *always* keep at least ONE of
    > > the files selected by the file spec

    >
    > It's specified, not selected.


    Perspective. We specify; PURGE selects files based upon our
    specification. PURGE, the actor in that sentence, doesn't specify.

    >
    > > and all other file selection
    > > qualifiers that you provide, if any exist, and it should keep the
    > > number of files you specify if that many exist. /KEEP means keep, not
    > > delete.

    >
    > And here we disagree. And we will always disagree on this.


    Um. On what do you disagree here? That /KEEP *doesn't* mean keep???

    >
    > So use /KEEP=2 and you'll get what you want. If the algorithm of PURGE
    > is changed to what you want it to be then I won't be able to do what I
    > want without writing a multiline DCL procedure.
    >


    I still don't follow this, and I don't find anyplace where you've
    actually explained it clearly.

    > > There should be no way for purge to delete every *selected* file.
    > > That's what DELETE is for, and because DELETE can remove all versions
    > > of files, it requires a more precise file spec. Again, PURGE is not
    > > DELETE.

    >
    > But commands like DELETE/BEFORE='time' risk the deletion of all
    > versions of a file. So I can't use DELETE without having to look at
    > the version number(s) I wish to keep and putting it(them) in the
    > exclude qualifier, which would only work if only one file is
    > specified. If multiple files are specified then I don't think you
    > could do it even with /EXCLUDE without explicitly typing out the full
    > name, type, and version number of each and every version I want to
    > keep (because there's no sticky-default action with /EXCLUDE!). What a
    > pain! It's much easier to use /KEEP=2 if you want to do it your way.
    >


    Sorry. Don't follow that at all.

    >
    >
    > > I guess I can only keep repeating what the documentation says, because
    > > that's the way it *should* work. But, that's not the way it works.

    >
    > > In reading everything you've written, I see you struggling. Your
    > > attempted "simplifications" show you are fighting the fact that the
    > > way PURGE works is not the way it was intended to work. PURGE is *NOT*
    > > DELETE. If you read the HELP and the doc's again, keeping that fact in
    > > mind, I think you'll see that the explanations are clear and precise.

    >
    > I'm struggling because I find it difficult to put my thoughts into
    > words. And I'm trying to be precise and explicit because words such as
    > earlier, older, file, version, etc. are not precise enough. I'm also
    > hoping that some variation of my explanation will make my point of
    > view clear to you.
    >


    Sorry. I haven't gotten it yet.

    > No, the doc is not clear and precise. If I just told you to get me a
    > maximum of three apples, how many will you bring? That's precise? "Oh,
    > get me anywhere from zero to three apples, okay?" That's what the
    > description of /KEEP is saying.
    >


    To completely satisfy the command:

    "Bring me a maximum of three apples, peon"
    "Yes, Sire, oh Gracious One. I am forever your humble servant." (bow,
    bow, bow, turn, leave room, run to the larder)

    If there are three or more apples I would bring you three apples.
    If there are fewer than three apples, I would bring you however many
    there are.
    That means that if there are no apples, I couldn't bring you any, but
    I would never bring you more than the three (MAX) that you requested.

    Bringing fewer than 3, though, might cost me my head so I'd probably
    pop out to the grocer and resupply the larder. I don't think the PURGE
    command should do that, however.

    ;-)

    >
    >
    > > In the ITRC discussion, Jon Pinkley demonstrated that the bug is not
    > > limited to the /BEFORE qualifier. I hope he doesn't mind if I quote
    > > some of his post here:

    >
    > > ################################################## ######
    > >
    > > [...]
    > > This discussion has convinced me that the behavior should be as you
    > > describe, since the "selected files" should be the set of files
    > > selected by the filespec and the qualifiers. The bug in purge is not
    > > limited to /before as is demonstrated by the following:

    >
    > > $ show system/noproc ! not portable ...
    > > OpenVMS V8.3 on node SIGMA 23-FEB-2007 22:23:30.28 Uptime 1 00:56:43
    > > $ analyze/image/select=(id,link) sys$system:delete.exe; ! not portable
    > > SYS$COMMON:[SYSEXE]DELETE.EXE;1
    > > "X-05"
    > > 29-JUN-2006 18:18:42.45
    > > $ directory/own/date=(cre,mod) pt.tmp;*

    >
    > > Directory SYS$SYSROOT:[SYSMGR]

    >
    > > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > > PT.TMP;3 3-JAN-2000 01:00:30.88 3-JAN-2000 01:01:30.88 [1,1]
    > > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    >
    > > Total of 5 files.
    > > $ purge/keep=2/by_own=[1,1]/log pt.tmp
    > > %PURGE-I-FILPURG, SYS$SYSROOT:[SYSMGR]PT.TMP;3 deleted (0 blocks)
    > > $ directory/own/date=(cre,mod) pt.tmp;*

    >
    > > Directory SYS$SYSROOT:[SYSMGR]

    >
    > > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    >
    > > Total of 4 files.

    >
    > See? There's too little whitespace. It clutters the visual field of
    > the mind and makes concentrating all that more difficult. Highly
    > unreadable.



    In Google, there is an option to switch to fixed font. Click on
    Options up in the colored title bar and you should find it. I hope
    that helps. I found that by accident one day.


    > You may as well try reading AUTOGEN.COM or STARTUP.COM. To
    > repeat the previous sentence in ITRC format:
    > YoumayaswelltryreadingAUTOGEN.COMorSTARTUP.COM. ;-) At least here it's
    > in a fixed-width font (I'm writing this reply in Wordpad and will
    > paste it into the Google Groups too-small input window.) And why both
    > the creation and modification dates? Ugh.
    >
    > > I have tested this on 7.2-2, 7.3-2 and 8.3, they all show this
    > > behavior. Including reproducer as attachment.

    >
    > > I think I have narrowed the conditions necessary to exhibit bug.

    >
    > > Some definitions:

    >
    > > Selection set: The set of files that meet the filespec and qualifiers.

    >
    > > Statement of problem:

    >
    > > If the highest version of a specific device:[directory]file.type is
    > > not a member of the selection set, and /keep versions > 1, then one
    > > less file is kept than specified by the /keep qualifier.

    >
    > > Expected cause: from source listings: [V732.DELETE.LIS]PURGE.LIS
    > > (which was more handy than 8.3)

    >
    > > In routine purge_ods2_files, at line 931 there is a check for a change
    > > in device, directory, name or type. If there is change, then in line
    > > 936 the versions (matching purge selection) is unconditionally set to
    > > 1, i.e. no check is made to see if this meets the requirements of the
    > > common qualifiers. If it isn't the highest version, then the routine
    > > purge_this_file is called. purge_this_file calls DEL$MATCH_FILENAME
    > > which checks if the file matches the selection criteria, and if so
    > > increments the versions seen, and if gtr than the specified /keep
    > > versions, deletes the file.
    > > [...]
    > >
    > > ################################################## ##

    >
    > > I believe this was formally reported to HP. I do not know its current
    > > status.

    >
    > Same thing, different color. All the same arguments apply. If you
    > don't like it use /KEEP=2.
    >


    ???????
    Read it again. Hopefully the fixed font option helped. He *did* say /
    KEEP=2 and it only kept ONE! My friend, that's a bug whether you
    accept it or not.


    > If you respond, please address my arguments instead of repeating
    > yours. I tried to repeat only the portions of my post you didn't
    > address. OK, maybe I'm just as guilty.


    I've tried. I hope we can still be friends 'cause I doubt anyone else
    is going to speak to us after all of these long posts we seem to
    generate:-)

    >
    > I said I can see it both ways. I prefer "my way" and you prefer "your
    > way". When done my way, you need only add 1 to whatever you supply to
    > the /KEEP qualifier when using other qualifiers. With your way I have
    > to go through a lot of pain to delete all versions that match the
    > selection qualifiers except to keep the current version
    > unconditionally. Why do you want to make it so painful for me?
    >


    I don't want to do anything other than have a command work the way it
    says it should.



  17. Re: Easy DCL question PURGE vs. DELETE

    I actually did some snipping here, but it's still pretty long, but all
    the important points are made early in the post. The rest is just
    detailed response and further elaboration of said points.

    On Aug 4, 4:42 pm, Doug Phillips wrote:
    > Sorry again, but this time for the length of the post.
    >
    > On Aug 4, 12:58 pm, AEF wrote:
    >
    > > On Aug 4, 12:55 pm, Doug Phillips wrote:

    >
    > > > On Aug 4, 8:50 am, AEF wrote:

    >
    > > > > On Aug 3, 5:49 pm, Doug Phillips wrote:

    >
    > > > > > On Aug 3, 3:46 pm, AEF wrote:

    >
    > > > [...]

    >
    > > > > > > How is it a bug?

    >
    > > > > > > $ DIR/WID=FILE=15/NOSIZE

    >
    > > > > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > > > > Total of 9 files.
    > > > > > > $

    >
    > > > > > > What would you expect for

    >
    > > > > > > A $ PURGE BLAH.TMP /BEFORE=16:37:06
    > > > > > > B $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=1
    > > > > > > C $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=2
    > > > > > > D $ PURGE BLAH.TMP /BEFORE=16:37:06 /KEEP=3

    >
    > > > > > For each of those, I would expect that if I did

    >
    > > > > > $ DIR/BEFORE=16:37:06

    >
    > > > > > I would see the same files that PURGE would select for consideration;

    >
    > > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68

    >
    > > > > > For your example A & B, I would expect to end up with:

    >
    > > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33

    >
    > > > > Hmmm. Since ;5 is before the time given to /BEFORE, and since it is
    > > > > not the highest version, I'd expect it to be deleted. Why would you
    > > > > expect ;5 to remain?

    >
    > > > Because the command is PURGE, *not* DELETE. Purge is supposed to keep
    > > > the highest (to a maximum of the specified number of) version(s) of
    > > > the *specified* files if any files match the selection criteria. The
    > > > default is the _specified_file(s)_ with the highest version number(s).
    > > > If you want to DELETE the files, then use DELETE. PURGE is *not*
    > > > DELETE.

    >
    > > I can see it both ways. The advantage of the current way is that you
    > > can delete all files older than a certain time except that the current
    > > version is always kept. How would you do this with your desired
    > > algorithm?

    >
    > There is *no* advantage to the current action of /keep. It does *not*
    > do what you describe above, as has been demonstrated here and
    > elsewhere --- unless you're allowing the definition of "current
    > version" to fall outside of the list of files that should be selected
    > by the filespec and its qualifiers.


    Yes it does, and yes, the current version often falls outside the
    "selected" versions of the file.

    The current version is the version with the highest version number,
    ignoring the selection criteria. In fact, the current version is
    always the highest version number of all the versions of a file
    regardless even of the command used. The current version is what you
    get when you specify ";" as the version number. Try DIR BLAH.TMP;/
    BEFORE=1-JUN-1900 on a file and see what you get:

    %DIRECT-W-NOFILES, no files found

    Therefore, the current version may or may not be among the versions
    that satisfy the selection qualifiers.

    This is obviously why you've completely misunderstood me on this
    issue.

    Now I think the simplest way to summarize this is that PURGE currently
    uses the current version as the first file to be kept no matter what
    qualifiers you add to the command. And this counts toward the value
    supplied to /KEEP. So even though it deletes all your old versions
    that satisfy your selection qualfiers, it still makes absolutely sure
    to keep one version, that version being the current version. And that
    is /KEEP=1, of course. It will, of course, keep all other versions
    that don't satisfy the selection qualifiers, but those don't count
    toward /KEEP.

    I would surmise that in your way of looking at it you only need to add
    the current version to the set of files to be considered for deletion
    to the set of versions that satisfy your selection qualifiers (if it's
    not already included) and then everything will make sense to you. IOW,
    by default, PURGE always keeps the current version. And by default, /
    KEEP=1 is assumed. These are considered the same by the code.
    Therefore, the current version is included in the keep count.

    The remainder of this post is just details responding to the quoted
    post.

    > > To be more explicit, let's use the example above. Suppose I want to
    > > get rid of all files older than 16:37:07, except to not delete the
    > > current version even if it too is older. I can do

    >
    > Which do you consider the "current version"??


    BLAH.TMP;9

    No matter what the PURGE command is, no matter what qualifiers you
    attach to it, the current version in this example is BLAH.TMP;9.
    Always. How can an intermediate version be current? It can't, and
    therefore isn't.

    > > $ PURGE BLAH.TMP /BEFORE=16:37:07

    >
    > By your command, purge should *ignore* all files named BLAH.TMP that
    > are dated *on or since* 16:37:07, as well as all files with any other
    > name that might reside within the current directory. So BLAH.TMP;9 and
    > BLAH.TMP;8 should be completely ignored --- just as a file named
    > BLAH.BLAH and all other files not matching your request should be
    > ignored.
    >
    > That means you are selecting these files for purge to process:
    >
    > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > BLAH.TMP;1 3-AUG-2007 16:37:01.68
    >
    > By your command, purge should keep the highest version of the selected
    > files, and purge the rest.
    >
    > That leaves BLAH.TMP;7 as the only remaining file that matches your
    > specification.


    No, because the current version is BLAH.TMP;9.

    > If you do a DIR BLAH.TMP after the purge, you should see:
    >
    > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    >
    > That is, two files that you didn't specify in your purge command, and
    > the "most current" version of the one you did.


    We're both confusing what each of us means by current and most-
    current.

    > If you want purge to delete files that don't match your specs &
    > qualifiers, then that's beyond my understanding.


    Becuase you've misunderstood what I mean by most-current version.
    BLAH.TMP;7 is not the most-current version; ;9 is. Actually, I don't
    like the term most-current here because it is causing problems. The
    current version is ;9, no matter what command you consider. If I want
    to read or execute a file, and I don't supply the version number
    (which, of course, is by far the most common means of reference) then
    the highest-numbered version of ALL versions of a file is what is
    used. If you want to refer to the highest-numbered version from a set
    of files that may or may not include the current version, please
    instead say "highest-numbered version from the set" (or in this case,
    the highest-numbered version from the versions that satisfy the
    selection qualifiers) instead of current or most-current. Thanks!

    What I want to do is the following: Suppose I have a directory with
    many different files and many versions of each file. Now, suppose I
    want to delete all old versions (non-current versions) that are older
    than a certain time. With the current VMS command, I can do it. I
    can't do it if they rewrite it to work your way (at least not easily
    -- I'd have to explicitly list the name, type and version number of
    each file I don't want to delete, in which case I may as well use
    PURGE/CONFIRM).

    Example 2:

    ONE.TMP;4 18:00
    ONE.TMP;3 17:00
    ONE.TMP;2 16:00
    TWO.TMP;8 14:00
    TWO.TMP;3 13:00
    TWO.TMP;1 12:00
    THREE.TMP;8 17:00
    THREE.TMP;6 15:00
    THREE.TMP;1 10:00

    Now suppose I want to PURGE this directory but only delete _old_
    versions older than 16:30. This would leave the following:

    ONE.TMP;4 18:00
    ONE.TMP;3 17:00
    TWO.TMP;8 14:00
    THREE.TMP;8 17:00

    Note that TWO.TMP;8 is older than 16:30, but it was saved because I
    used PURGE. Had I used DELETE it would be gone! NOW do you understand
    what I'm trying to do? I can easily do this with the current version
    of PURGE. I can't do this with your version of PURGE unless you add
    the possibility of /KEEP=0 which I would consider to be a rather
    bizarre option for a PURGE command. I want to delete all versions of
    all files that are older than a specified time except those versions
    that are current versions of their respective files. This way I save
    all current versions but delete all old versions that are before the
    specified time. By the current version of a file I ALWAYS mean the
    highest-numbered version from among ALL versions the file, not just
    those that match the other selection qualifiers. If I wanted to save
    one additional version of each file I would add /KEEP=2. This is
    consistent with the current version always contributing to the keep
    count.

    > > and versions 7 thru 5 will be deleted. You can't do that with your
    > > desired algorithm. You can counter by saying, well you should use
    > > DELETE.

    >
    > I will! If you want to DELETE files, use the DELETE command. If you
    > want to PURGE files, use the PURGE command. THEY ARE NOT THE SAME
    > COMMAND. (excuse me, I'll try to use my indoor voice from now on


    Relax, dude. Chill out. Take your shoes off. Sit a spell. Y'all come
    back now!

    Hey, they both call DELETE.EXE! :-)

    > > Well I can counter by saying suppose I want to do the same
    > > command except using the time 17:00 but be sure the current version is
    > > unconditionally not deleted:

    >
    > > $ PURGE BLAH.TMP /BEFORE=17

    >
    > > Now, all versions satisfy the criterion but the first one is kept.
    > > This way I can freely construct commands like this and be sure that I
    > > always leave the current version intact. There is no way to do this
    > > with the algorithm you prefer without an unreaonable amount of pain.

    >
    > That would work the same as if you didn't use the /before. All
    > existing BLAH.TMP files match your request, so all except the highest
    > will be purged. What are you asking?


    Sorry, I didn't mean this in the context of my first example. I meant
    it to show, _in general_, that if I err, by using PURGE I at least
    don't risk losing the current version as I would if I use DELETE.

    > > If you don't like the current algorithm you can always just add one to
    > > the number you would otherwise supply to the /KEEP qualifier. But if
    > > your algorithm is implemented there is not way, short of writing a
    > > multi-line DCL procedure (or a painful /EXCLUDE qualifier), to do what
    > > I want as described just above.

    >
    > You'd really accept that? "HELP PURGE /KEEP --- To keep 3 versions of
    > a file, specify /KEEP=4" ?? Sorry, there's something about that that
    > just seems wrong.


    It actually keeps more than that even. If you have 9 versions of a
    file, and 6 of them are older than your /BEFORE time, the PURGE will
    keep 3 versions, which is 2 more than 1. But the current version
    always contributes to the keep count and the highest-numbered versions
    that satisfy the selection qualifiers also contribute of the keep
    count.

    [...]
    >
    > > I see it this way:

    >
    > > $ PURGE ! Delete all but the current version

    >
    > [of each unique filename.ext in the current directory] Right
    >
    > > $ PURGE/BEFORE=time ! Consider the same versions for deletion as in
    > > PURGE, but delete only the versions that meet the /BEFORE=time
    > > criterion.

    >
    > Wrong. It should consider only the files that the command specifies:
    > those dated /before=time. It should ignore *all* other files
    > regardless of their name, version, age, color, religion, creed,
    > national origin,....(sorry, mind wandered there for a bit.) You are
    > wanting PURGE to act like DELETE --- and, btw, DELETE, DIR, COPY,
    > BACKUP, RENAME,... only consider the files you specify, and I wouldn't
    > want it any other way.


    I finally understand your point of view now that I know that by
    "current version" you mean the highest version from among the versions
    that satisfy the selection qualifiers. I think the confusion here
    stems from one or both of us sloppily using "current", "most-current",
    and "highest-numbered version" interchangeably. Under no circumstances
    would I ever consider an intermediate version the current version.
    >From this, I believe, stems all or most of the misunderstanding

    between us on this issue.

    I agree that there's good logic behind your way. (I still find PURGE/
    BEFORE=time leaving one matching version left if it's not the current
    version rather odd, but both ways have their odd points.) But there's
    good logic behind the current way, too.

    [...]
    > > > > There are various ways to mix /KEEP and /BEFORE. One could apply /
    > > > > KEEP=n first, mark those n files as keepers, and then delete any
    > > > > others that are timestamped before the specified time t0. That's one
    > > > > way to do it -- method 1. OK. Method 2: The way you appear to favor is
    > > > > that we look at the files that are timestamped as being before time
    > > > > t0, and apply /KEEP=n solely within those. The third way is what VMS
    > > > > does -- method 3.

    >
    > > > There is no "my way". There is no "mix" of /KEEP and /BEFORE. These
    > > > PURGE qualifiers are precisely explained in the HELP and the Doc's.
    > > > You are fighting those definitions trying to find an explanation that
    > > > fits how the command malfunctions. You are trying to apply the logic
    > > > of the DELETE command to PURGE. PURGE is not DELETE!

    >
    > > The doc is ambigiuous for /KEEP. I already proved this.

    >
    > I don't think the doc is ambiguous, and I don't find any "proof" in
    > your statements.


    We disagree. I still find the description of /KEEP ambiguous and it's
    even worse when you consider the possibility of adding the selection
    qualifiers.

    > > > The /BEFORE qualifier is a FILE SELECTOR. It says select files dated
    > > > before this date. That's the way /BEFORE works in this command and all
    > > > of the other DCL commands where it's used. That is as simple as it
    > > > gets.

    >
    > > It depends on what you mean by "file".

    >
    > Okay, Bill Clinton;-)


    Good one! :-) SBNQLOL

    I think it would help to define file and version here:

    file - name.typ, of which there are various versions

    version - name.typ;n

    Or better: FILE.TMP;3, FILE.TMP;2, FILE.TMP;1 are the three *versions*
    of the file called FILE.TMP!.

    So, name.typ;1, name.typ;2, ..., name.typ;n, are the n versions of the
    file name.typ. File here should mean the family of versions with the
    same dev, dir, name, and type. If you use file to also mean version
    (and after all, each version *is* a file, and that's certainly valid
    and useful for other things), then it will only further cloud the
    issue under discussion. So for this discussion, can we agree to do
    this? For this discussion, you PURGE files, but you DELETE versions
    (both in the context of using the PURGE command). Okay?

    > > I can have multiple versions of
    > > one file. That use of file means one file. But each version is itself
    > > a "file", but in another sense, which then means multiple files.
    > > Besides, /BEFORE "selects" which versions can be deleted. The
    > > parameter "specifies" which files are to be PURGEd.

    >
    > No. The parameter specifies which files should be considered by the
    > purge command. Anywhere from zero to many files might be actually
    > purged.
    > Put a * or % wild-card in the file spec someplace and think about how
    > that fits what you say.


    A wildcard specifies files, not versions. You can't specify the
    version field with the PURGE command, much less with a wildcard!

    > > > The /KEEP says how many of the SELECTED files should be kept if more
    > > > than that number exist. The default is one.

    >
    > > That's not what the doc says. The doc says this:

    >
    > > /KEEP=number-of-versions
    > > Specifies the maximum number of versions of the specified files to be
    > > retained in the directory. If you do not include the /KEEP qualifier,
    > > all but the highest numbered version of the specified files are
    > > deleted from the directory.

    >
    > Other than the word count and perspective (selected vs specified) how
    > does what I said contradict the doc?


    That's not the point. The point is that other actions are possible
    that also don't contradict the doc. You can keep fewer versions than
    what you said and the number kept will still be less than the maximum.
    Hence the ambiguity. IOW, if I say to you that I will at some point
    bring you a maximum of 4 apples, all you know is that I will bring
    somewhere between zero and four apples. That's not good enough.

    It would be much better if the doc said this instead (ignoring the
    possibility of adding selection qualifiers for now):

    /KEEP=number-of-versions
    The n highest versions of each of the specified files will be kept
    unless there are fewer than n versions for a particular file, in which
    case all versions of that file will kept. If you do not include the /
    KEEP qualifier, all but the highest-numbered version of each of the
    specified files are deleted from the directory. Thus the default value
    for number-of-versions is 1.

    This is what I would call a sufficiently precise description of what
    PURGE does when you don't specify selection qualifiers.

    selection qualifiers - /CREATED /MODIFIED /EXPIRED /BACKUP /SINCE /
    BEFORE /BY_OWNER

    > It the perspective? Here: the purge command should "select" only the
    > files that you "specify." Clearer?


    Nope, not clear at all. I have no idea what this means.

    > > It's too vague to be of any use. Besides, you specify with the
    > > parameter. The qualifiers select, not specify.

    >
    > To me, it reads clear and precise. I think you're just refusing to
    > accept it.


    See above.

    [...]

    [...I'm snipping a few paragraphs here because somehow they've become
    an incomprehensible mess...]

    > > And here we disagree. And we will always disagree on this.

    >
    > Um. On what do you disagree here? That /KEEP *doesn't* mean keep???


    I thought I explained the motivation for the current behavior. I'll
    try again.

    $ PURGE parameter

    means delete all but the current versions of files matching the
    parameter.

    $ PURGE parameter /KEEP=1

    is the same because the default value for /KEEP is 1.

    $ PURGE parameter /KEEP=n

    means keep n-1 more versions of each file than /KEEP=1, keeping the
    versions with the highest possible version numbers.

    $ PURGE parameter /BEFORE=time

    deletes all non-current versions that are before 'time'.

    $ PURGE parameter /BEFORE=time /KEEP=1

    does the same.

    $ PURGE parameter /BEFORE=time /KEEP=n

    means keep n-1 more versions than /KEEP=1, keeping the versions with
    the highest possible version numbers.

    It is the fact that the author of PURGE chose to make

    $ PURGE parameter /BEFORE=time

    work the way I described (to delete _all_ old versions [non-current
    versions] of the specified files that satisfy the selection
    qualifiers) combined with the fact that 1 is the default value for /
    KEEP that brings about the current behavior.

    So if you simply include the current version in the keep count, all
    makes sense. And since the most important thing PURGE does is to not
    delete the current version, it makes sense that the current version
    contribute to the keep count.

    You don't like this because combining /KEEP=1 with selection
    qualifiers will sometimes not leave a file that matches your selection
    qualifiers. Also, you want to keep n versions from among those files
    that match the selection qualifiers. I'm fine with that as a
    reasonable algorithm. The only problem with it is that it doesn't
    permit you to do the particular type of operation I described way
    above (in Example 2) in which I want to delete all old versions that
    satisfy the selection qualifiers (again, not deleting any current
    versions of files that satisfy the selection qualifiers).

    I have to admit that back in the mid 1980's when I first started using
    VMS, I too was surprised by PURGE/KEEP/BEFORE. But I started with the
    assumption that what PURGE did was somehow "correct" -- or at least
    one of several reasonable possibilities -- and experimented and
    analyzed the situation. I found that PURGE/BEFORE would delete all old
    versions of files that satisfied the /BEFORE qualifier. I thought that
    made sense. Then I realized that the default was /KEEP=1 even in that
    case and that naturally /KEEP=2 would keep only one of the old
    versions that satisfied the /BEFORE qualifier, basically because 2 is
    one more than 1. So I assumed that the version of the file that is one
    version higher than the highest old version that satisfied the /BEFORE
    qualifier counted as one kept. Or you can consider the current version
    to be that 1st to-be-kept file, which I now think is a better way to
    look at it. I mean, PURGE *always* keeps the current version, so why
    not include it in the count? I need to do an example here.

    Example 3:

    > > > > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07
    > > > > > > BLAH.TMP;5 3-AUG-2007 16:37:05.33
    > > > > > > BLAH.TMP;4 3-AUG-2007 16:37:04.50
    > > > > > > BLAH.TMP;3 3-AUG-2007 16:37:03.68
    > > > > > > BLAH.TMP;2 3-AUG-2007 16:37:02.80
    > > > > > > BLAH.TMP;1 3-AUG-2007 16:37:01.68


    So doing PURGE/BEFORE=16:37:06 would leave

    > > > > > > Directory SYS$SYSDEVICE:[TEST]

    >
    > > > > > > BLAH.TMP;9 3-AUG-2007 16:37:08.15
    > > > > > > BLAH.TMP;8 3-AUG-2007 16:37:07.53
    > > > > > > BLAH.TMP;7 3-AUG-2007 16:37:06.78
    > > > > > > BLAH.TMP;6 3-AUG-2007 16:37:06.07


    and version ;6 would count as one version for /KEEP (by my original
    thinking back in the mid-80;s -- I now think it makes more sense to
    consider ;9 to be the first version to be kept). Specifying n instead
    of 1 would then keep n-1 more of the highest-numbered versions that
    satisfy the /BEFORE qualifier. This makes sense since /KEEP=n should
    keep n-1 more versions than /KEEP=1. Right?

    So /KEEP=1 means keep the current version and /KEEP=n means keep the
    current version and n-1 more highest-numbered versions.

    > > So use /KEEP=2 and you'll get what you want. If the algorithm of PURGE
    > > is changed to what you want it to be then I won't be able to do what I
    > > want without writing a multiline DCL procedure.

    >
    > I still don't follow this, and I don't find anyplace where you've
    > actually explained it clearly.


    I'm explaining it clearly here! So now you agree that the doc isn't
    clear, eh? ;-)

    > > > There should be no way for purge to delete every *selected* file.
    > > > That's what DELETE is for, and because DELETE can remove all versions
    > > > of files, it requires a more precise file spec. Again, PURGE is not
    > > > DELETE.

    >
    > > But commands like DELETE/BEFORE='time' risk the deletion of all
    > > versions of a file. So I can't use DELETE without having to look at
    > > the version number(s) I wish to keep and putting it(them) in the
    > > exclude qualifier, which would only work if only one file is
    > > specified. If multiple files are specified then I don't think you
    > > could do it even with /EXCLUDE without explicitly typing out the full
    > > name, type, and version number of each and every version I want to
    > > keep (because there's no sticky-default action with /EXCLUDE!). What a
    > > pain! It's much easier to use /KEEP=2 if you want to do it your way.

    >
    > Sorry. Don't follow that at all.


    Same reason. You misunderstood what I meant by current version. How
    can you possibly call any intermediate version the current version?
    There's current, and then there's most-current, which are not the
    same, but perhaps are being assumed synonymous by one or both of us. I
    think most-current is a problematic term here and should be avoided.

    > > > I guess I can only keep repeating what the documentation says, because
    > > > that's the way it *should* work. But, that's not the way it works.

    >
    > > > In reading everything you've written, I see you struggling. Your
    > > > attempted "simplifications" show you are fighting the fact that the
    > > > way PURGE works is not the way it was intended to work. PURGE is *NOT*
    > > > DELETE. If you read the HELP and the doc's again, keeping that fact in
    > > > mind, I think you'll see that the explanations are clear and precise.

    >
    > > I'm struggling because I find it difficult to put my thoughts into
    > > words. And I'm trying to be precise and explicit because words such as
    > > earlier, older, file, version, etc. are not precise enough. I'm also
    > > hoping that some variation of my explanation will make my point of
    > > view clear to you.

    >
    > Sorry. I haven't gotten it yet.


    Again, current version meant different things to us.

    > > No, the doc is not clear and precise. If I just told you to get me a
    > > maximum of three apples, how many will you bring? That's precise? "Oh,
    > > get me anywhere from zero to three apples, okay?" That's what the
    > > description of /KEEP is saying.

    >
    > To completely satisfy the command:
    >
    > "Bring me a maximum of three apples, peon"
    > "Yes, Sire, oh Gracious One. I am forever your humble servant." (bow,
    > bow, bow, turn, leave room, run to the larder)
    >
    > If there are three or more apples I would bring you three apples.
    > If there are fewer than three apples, I would bring you however many
    > there are.
    > That means that if there are no apples, I couldn't bring you any, but
    > I would never bring you more than the three (MAX) that you requested.
    >
    > Bringing fewer than 3, though, might cost me my head so I'd probably
    > pop out to the grocer and resupply the larder. I don't think the PURGE
    > command should do that, however.
    >
    > ;-)


    OK, so you should now see why I find the description for /KEEP
    ambiguous.

    > > > In the ITRC discussion, Jon Pinkley demonstrated that the bug is not
    > > > limited to the /BEFORE qualifier. I hope he doesn't mind if I quote
    > > > some of his post here:

    >
    > > > ################################################## ######
    > > >
    > > > [...]
    > > > This discussion has convinced me that the behavior should be as you
    > > > describe, since the "selected files" should be the set of files
    > > > selected by the filespec and the qualifiers. The bug in purge is not
    > > > limited to /before as is demonstrated by the following:

    >
    > > > $ show system/noproc ! not portable ...
    > > > OpenVMS V8.3 on node SIGMA 23-FEB-2007 22:23:30.28 Uptime 1 00:56:43
    > > > $ analyze/image/select=(id,link) sys$system:delete.exe; ! not portable
    > > > SYS$COMMON:[SYSEXE]DELETE.EXE;1
    > > > "X-05"
    > > > 29-JUN-2006 18:18:42.45
    > > > $ directory/own/date=(cre,mod) pt.tmp;*

    >
    > > > Directory SYS$SYSROOT:[SYSMGR]

    >
    > > > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > > > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > > > PT.TMP;3 3-JAN-2000 01:00:30.88 3-JAN-2000 01:01:30.88 [1,1]
    > > > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > > > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    >
    > > > Total of 5 files.
    > > > $ purge/keep=2/by_own=[1,1]/log pt.tmp
    > > > %PURGE-I-FILPURG, SYS$SYSROOT:[SYSMGR]PT.TMP;3 deleted (0 blocks)
    > > > $ directory/own/date=(cre,mod) pt.tmp;*

    >
    > > > Directory SYS$SYSROOT:[SYSMGR]

    >
    > > > PT.TMP;5 1-JAN-2000 01:00:31.11 1-JAN-2000 01:01:31.11 [SYSTEM]
    > > > PT.TMP;4 2-JAN-2000 01:00:30.99 2-JAN-2000 01:01:30.99 [1,1]
    > > > PT.TMP;2 4-JAN-2000 01:00:30.78 4-JAN-2000 01:01:30.78 [SYSTEM]
    > > > PT.TMP;1 5-JAN-2000 01:00:30.64 5-JAN-2000 01:01:30.64 [SYSTEM]

    >
    > > > Total of 4 files.

    >
    > > See? There's too little whitespace. It clutters the visual field of
    > > the mind and makes concentrating all that more difficult. Highly
    > > unreadable.

    >
    > In Google, there is an option to switch to fixed font. Click on
    > Options up in the colored title bar and you should find it. I hope
    > that helps. I found that by accident one day.


    My Google Groups already shows it in fixed-width font but I still find
    it a struggle to read as there is only one space between different
    fields as there is only one space between the date and time, making it
    a cluttered mess!!!

    And why was /date=(c,m) specified? That only clutters things up even
    more! Certainly not the clearest way to make a point!

    [...]

    > > > I think I have narrowed the conditions necessary to exhibit bug.

    >
    > > > Some definitions:

    >
    > > > Selection set: The set of files that meet the filespec and qualifiers.

    >
    > > > Statement of problem:

    >
    > > > If the highest version of a specific device:[directory]file.type is
    > > > not a member of the selection set, and /keep versions > 1, then one
    > > > less file is kept than specified by the /keep qualifier.

    >
    > > > Expected cause: from source listings: [V732.DELETE.LIS]PURGE.LIS
    > > > (which was more handy than 8.3)

    >
    > > > In routine purge_ods2_files, at line 931 there is a check for a change
    > > > in device, directory, name or type. If there is change, then in line
    > > > 936 the versions (matching purge selection) is unconditionally set to
    > > > 1, i.e. no check is made to see if this meets the requirements of the
    > > > common qualifiers. If it isn't the highest version, then the routine
    > > > purge_this_file is called. purge_this_file calls DEL$MATCH_FILENAME
    > > > which checks if the file matches the selection criteria, and if so
    > > > increments the versions seen, and if gtr than the specified /keep
    > > > versions, deletes the file.


    I have no idea what this paragraph means. If there is a change in the
    device, directory, name, or type, then certainly we've hit upon the
    current version, right? What does "the versions [...] is
    unconditionally set to 1" mean? What is "the versions"? Then, "if it
    isn't the highest version" (I assume this mean my version of "current
    version") means that the current version is included in the keep
    count, which, since PURGE is going through effort to keep the current
    version, includes it in the keep count.

    Please, the quoted paragraph above is a complete nightmare to
    interpret. I don't know which is worse, the doc's description of /KEEP
    or this!

    > > > [...]
    > > >
    > > > ################################################## ##

    >
    > > > I believe this was formally reported to HP. I do not know its current
    > > > status.

    >
    > > Same thing, different color. All the same arguments apply. If you
    > > don't like it use /KEEP=2.

    >
    > ???????
    > Read it again. Hopefully the fixed font option helped. He *did* say /
    > KEEP=2 and it only kept ONE! My friend, that's a bug whether you
    > accept it or not.


    But the current version also counts as one and then one plus one
    equals 2.

    > > If you respond, please address my arguments instead of repeating
    > > yours. I tried to repeat only the portions of my post you didn't
    > > address. OK, maybe I'm just as guilty.

    >
    > I've tried. I hope we can still be friends 'cause I doubt anyone else
    > is going to speak to us after all of these long posts we seem to
    > generate:-)


    I'm frustrated, but not angry.

    Apparently the main sticking point is that we had very different ideas
    of what "current version" means. To me, PURGE means, above all else,
    make sure you keep at least the highest-numbered version. When I
    execute or read a file without specifying its version number, it will
    always run the current version. And that's because the default for a
    missing version-number spec is ";" (see my second paragraph way, way
    above). (Does anyone actually have command procedures that run
    explicitly specified intermediate versions?) So "my current version"
    is far more important than any intermediate version. How can an
    intermediate version ever be the current version? Come to think of it,
    I find the term "most-current" to be somewhat nonsensical. You're
    current or you're not.

    I accept your version as a reasonable possibility (except I'd miss a
    certain capability that PURGE currently has). We only disagree whether
    my version is a reasonable alternative or not. But you have to admit
    the "my version" (the current VMS version) has a capability that yours
    doesn't!

    > > I said I can see it both ways. I prefer "my way" and you prefer "your
    > > way". When done my way, you need only add 1 to whatever you supply to
    > > the /KEEP qualifier when using other qualifiers. With your way I have
    > > to go through a lot of pain to delete all versions that match the
    > > selection qualifiers except to keep the current version
    > > unconditionally. Why do you want to make it so painful for me?

    >
    > I don't want to do anything other than have a command work the way it
    > says it should.


    Whatever.

    AEF


  18. Re: Easy DCL question PURGE vs. DELETE

    On Aug 5, 12:46 pm, AEF wrote:
    [...]
    >
    > Apparently the main sticking point is that we had very different ideas
    > of what "current version" means. To me, PURGE means, above all else,
    > make sure you keep at least the highest-numbered version. When I


    Sorry, replace "highest-numbered version" with "current version". I
    mean here the highest-numbered version of ALL the versions of the file
    in question, irrespective of any selection qualifiers that might be
    present. This is the raison d'etre for the PURGE command. And this
    version, the current version, always contributes to the keep count.

    > execute or read a file without specifying its version number, it will
    > always run the current version. And that's because the default for a
    > missing version-number spec is ";" (see my second paragraph way, way
    > above). (Does anyone actually have command procedures that run
    > explicitly specified intermediate versions?) So "my current version"
    > is far more important than any intermediate version. How can an
    > intermediate version ever be the current version? Come to think of it,
    > I find the term "most-current" to be somewhat nonsensical. You're
    > current or you're not.

    [...]

    "Back to a Paul Lynde question" -- Peter Marshall on the original
    version of "The Hollywood Squares"

    AEF


  19. Re: Easy DCL question PURGE vs. DELETE

    On Aug 5, 12:33 pm, AEF wrote:
    > On Aug 5, 12:46 pm, AEF wrote:
    > [...]
    >
    >
    >
    > > Apparently the main sticking point is that we had very different ideas
    > > of what "current version" means. To me, PURGE means, above all else,
    > > make sure you keep at least the highest-numbered version. When I

    >
    > Sorry, replace "highest-numbered version" with "current version". I
    > mean here the highest-numbered version of ALL the versions of the file
    > in question, irrespective of any selection qualifiers that might be
    > present. This is the raison d'etre for the PURGE command. And this
    > version, the current version, always contributes to the keep count.
    >
    > > execute or read a file without specifying its version number, it will
    > > always run the current version. And that's because the default for a
    > > missing version-number spec is ";" (see my second paragraph way, way
    > > above). (Does anyone actually have command procedures that run
    > > explicitly specified intermediate versions?) So "my current version"
    > > is far more important than any intermediate version. How can an
    > > intermediate version ever be the current version? Come to think of it,
    > > I find the term "most-current" to be somewhat nonsensical. You're
    > > current or you're not.

    >
    > [...]


    I'll reply here rather that waste band-width quoting one of our other
    incredibly long and winding posts.

    AEF, purge does not work the way you describe.

    Since you can't look at ITRC, and see Jon Pinkley's reproducer I'll
    paste it in here (hope you don't mind, Jon). It'll probably wrap, but
    I can't help that.

    I've commented out the analyze/image (your VAX v6.2 would probably
    choke on it), removed the double-dates from the directory display, put
    some "white space" around the purge command, and shortened the exit to
    just exit. Other than the mod notice, it's as it was.

    He included both creation and modification dates on the create fdl
    lines so you can "play" with different purge qualifies if you want.
    This reproducer purges on by_owner.

    Run it, see what it does. Change the purge to whatever you want, and
    run it as many times as you want. Based on the results, what does
    PURGE consider the "current version" to be?

    ################################################## #

    $! Q&D to reproduce purge bug where one less version is kept than
    expected.
    $! Jon Pinkley 2007-02-23 (minor mod's by Doug Phillips 2007-08-05)
    $ directory/own/date pt.tmp;*
    $ read sys$command /prompt="Ok to delete all pt.tmp files and
    recreate? : " ok
    $ if .not. ok then goto _exit
    $ delete:=delete
    $ create:=create
    $ directory:=directory
    $ purge:=purge
    $ show:=show
    $ analyze:=analyze
    $ delete pt.tmp;*
    $ show system/noproc ! not portable ...
    $!$ analyze/image/select=(id,link) sys$system:delete.exe; ! not
    portable ...
    $!
    $ create/fdl=sys$input pt.tmp;1
    file;organization sequential;owner [1,4];date;creation "5-JAN-2000
    01:00";revision "5-JAN-2000 01:01"
    $ create/fdl=sys$input pt.tmp;2
    file;organization sequential;owner [1,4];date;creation "4-JAN-2000
    01:00";revision "4-JAN-2000 01:01"
    $ create/fdl=sys$input pt.tmp;3
    file;organization sequential;owner [1,1];date;creation "3-JAN-2000
    01:00";revision "3-JAN-2000 01:01"
    $ create/fdl=sys$input pt.tmp;4
    file;organization sequential;owner [1,1];date;creation "2-JAN-2000
    01:00";revision "2-JAN-2000 01:01"
    $ create/fdl=sys$input pt.tmp;5
    file;organization sequential;owner [1,4];date;creation "1-JAN-2000
    01:00";revision "1-JAN-2000 01:01"
    $ directory/own/date pt.tmp;*
    $!
    $ purge/keep=2/by_own=[1,1]/log pt.tmp
    $!
    $ directory/own/date pt.tmp;*
    $_exit:
    $ exit

    #######################################


  20. Re: Easy DCL question PURGE vs. DELETE

    On Aug 5, 2:20 pm, Doug Phillips wrote:
    > On Aug 5, 12:33 pm, AEF wrote:
    >
    > > On Aug 5, 12:46 pm, AEF wrote:
    > > [...]

    >
    > > > Apparently the main sticking point is that we had very different ideas
    > > > of what "current version" means. To me, PURGE means, above all else,
    > > > make sure you keep at least the highest-numbered version. When I

    >
    > > Sorry, replace "highest-numbered version" with "current version". I
    > > mean here the highest-numbered version of ALL the versions of the file
    > > in question, irrespective of any selection qualifiers that might be
    > > present. This is the raison d'etre for the PURGE command. And this
    > > version, the current version, always contributes to the keep count.

    >
    > > > execute or read a file without specifying its version number, it will
    > > > always run the current version. And that's because the default for a
    > > > missing version-number spec is ";" (see my second paragraph way, way
    > > > above). (Does anyone actually have command procedures that run
    > > > explicitly specified intermediate versions?) So "my current version"
    > > > is far more important than any intermediate version. How can an
    > > > intermediate version ever be the current version? Come to think of it,
    > > > I find the term "most-current" to be somewhat nonsensical. You're
    > > > current or you're not.

    >
    > > [...]

    >
    > I'll reply here rather that waste band-width quoting one of our other
    > incredibly long and winding posts.
    >
    > AEF, purge does not work the way you describe.


    Yes it does.

    > Since you can't look at ITRC, and see Jon Pinkley's reproducer I'll
    > paste it in here (hope you don't mind, Jon). It'll probably wrap, but
    > I can't help that.
    >
    > I've commented out the analyze/image (your VAX v6.2 would probably
    > choke on it), removed the double-dates from the directory display, put
    > some "white space" around the purge command, and shortened the exit to
    > just exit. Other than the mod notice, it's as it was.
    >
    > He included both creation and modification dates on the create fdl
    > lines so you can "play" with different purge qualifies if you want.


    But then why was /date=(c,m) included in the DIR command when the
    example only purges by owner?

    > This reproducer purges on by_owner.
    >
    > Run it, see what it does. Change the purge to whatever you want, and
    > run it as many times as you want. Based on the results, what does
    > PURGE consider the "current version" to be?


    [... DCL code omitted ...]

    OK. I copied the code to my system, tidied it up, and ran it.

    It works exactly as I have described:

    $ directory/own/date pt.tmp;* ! we don't need /DATE here -- I
    forgot to trim it off

    Directory DISK$DATA1:[TEST.DCL.PURGE]

    PT.TMP;5 1-JAN-2000 01:00:43.50 [SYSTEM]
    PT.TMP;4 2-JAN-2000 01:00:43.39 [1,1]
    PT.TMP;3 3-JAN-2000 01:00:43.28 [1,1]
    PT.TMP;2 4-JAN-2000 01:00:43.17 [SYSTEM]
    PT.TMP;1 5-JAN-2000 01:00:43.07 [SYSTEM]

    Total of 5 files.
    $!
    $ purge/keep=2/by_own=[1,1]/log pt.tmp
    %PURGE-I-FILPURG, DISK$DATA1:[TEST.DCL.PURGE]PT.TMP;3 deleted (0
    blocks)
    $!
    $ directory/own/date pt.tmp;*

    Directory DISK$DATA1:[TEST.DCL.PURGE]

    PT.TMP;5 1-JAN-2000 01:00:43.50 [SYSTEM]
    PT.TMP;4 2-JAN-2000 01:00:43.39 [1,1]
    PT.TMP;2 4-JAN-2000 01:00:43.17 [SYSTEM]
    PT.TMP;1 5-JAN-2000 01:00:43.07 [SYSTEM]

    Total of 4 files.
    $_exit:
    $ exit

    The current version is PT.TMP;5. As I said last time, the current
    version _always_ contributes to the keep-count. So it kept two
    versions: ;5 and ;4.

    Had I omitted the /KEEP=2 or specified /KEEP=1, it would have also
    deleted PT.TMP;4, keeping one version.

    The keep-count is the sum of the following two things:

    1. The number 1 for the current version
    2. The number of old versions that match /BY_OWNER=[1,1]

    Nothing else contributes to the keep-count. In this example, the
    initial keep-count (which is a function of the selction qualifiers) is
    3 which is from ;5, ;4, and ;3 because ;5 is the current version and
    versions ;4 and ;3 match the selction qualifier.

    After the command only versions ;5 and ;4 contribute to the keep count
    and that gives 2 which is what the command specified.

    Now, in general:

    If the keep-count is initially .LE. the keep-value, PURGE deletes no
    versions of the file. If the keep-count is .GT. the keep-value, PURGE
    then deletes matching versions in ascending version order (in this
    case versions matching /BY_OWNER=[1,1]) until the keep-count is equal
    to the keep-value.

    That's how it works. That's what I said in my previous post.

    AEF


+ Reply to Thread
Page 1 of 2 1 2 LastLast