[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

680.0. "Bulk delete of calendar events" by NCCODE::HARRIS (oooppps) Tue May 12 1992 23:26

    Hi,
    
    My user has requested me to find a way to delete all calendar events
    (meetings and appts) that are older than 01-01-91 for ALL users on the
    system.
    
    I've been reading the APR2 for CALENDAR functions and the calendar
    cancel works on just 1 meeting at a time.
    
    Has anyone written a procedure that will read thru a users calendar and
    delete all events older than a specific date?  Or can just some
    hints...  Eventually, this will be resubmitted and run once a month.
    
    	Thanks - Ann
    
    PS - ALL-IN-1 2.4, no patches
    The customer is trying to be a good doobie and clean up disk space.
T.RTitleUserPersonal
Name
DateLines
680.1SuggestionsSHALOT::NICODEMWho told you I'm paranoid???Wed May 13 1992 14:2421
	Ann,

	I don't know of any available applications, but what I'd suggest is a
simple procedure that first requests the "delete-before" date (and should
probably validate that it's in the past -- you don't want to delete future
events, because there's too much Calendar checking and stuff); then either
using a FOR CAL$CALENDAR... loop, or simply walking through the calendar one
event at a time, delete the events.

	BTW, if you write such a routine, let the rest of us know; it could be
quite useful.

	What would also be useful, in terms of "clean-up", would be something
that would provide "janitor" capabilities on the system calendar files --
ATTENDEE.DAT and MEETING.DAT.  Right now, they only grow; they don't shrink.  So
it's not uncommon to fill them up with events from years in the past...  with no
way to get rid of them.  That makes these files grow, and performance degrades.
Now if your user gets really agressive and writes an application to include
*that* in the clean-up, *really* let us know!  8^)

	F
680.2Isn't there already a CALENDAR PURGE function?SHALOT::WARFORDRichard Warford @OPA DTN 393-7495Wed May 13 1992 14:5811
    Ah, isn't there a CALENDAR PURGE function that takes a date as its
    parameter? It only runs for a single account, but with the old
    FOR PROFIL DO NEWDIR loop it could handle everyone....
    
    Note that most of these things only clean up the calendar files, the
    ACTITEM.DAT may also need cleaned. I don't know of any functions to
    clear that automatically, but it is just a straight entry form with
    date fields in it, so standard FOR functions can be used to clean it
    up.
    
    RIck
680.3YepAIMTEC::ZANIEWSKI_DWhy would CSC specialists need training?Wed May 13 1992 15:146
        Rick has a good suggestion.  I just SPR'd the function (bad
        documentation).  Required symbols are #CAL_PURGE_FROMDATE and
        #CAL_PURGE_TODATE instead of what is documented.  Pretty self
        explanatory.
        
        Dave Zaniewski
680.4CALENDAR PURGE_TASKSSHALOT::NICODEMWho told you I'm paranoid???Thu May 14 1992 14:233
�    Note that most of these things only clean up the calendar files, the
�    ACTITEM.DAT may also need cleaned. I don't know of any functions to
�    clear that automatically
680.5still trying after all thesse monthsANGLIN::HARRISABicycles need seat beltsThu Aug 19 1993 18:1218
    well a year later...
    
    the customer is still looking for this and i've had
    the time to come up with a very small script. the script apears to work
    (in that my test events are deleted) but in doing a trace, the DATE
    CONVERT doesn't seem to be executed.
    
    Here is a copy of the script...
    This is an adaptation from the PURGE form
    
    get #style="7"
    for profil with .user eqs "manager" do -
            get #cal_purge_fromdate = "1-jan-1990"\\
            date_convert #nbs_fromdate, #cal_purge_fromdate, #style\\
            get #cal_purge_todate = "1-jan-1991"\\
            date_convert #nbs_todate, #cal_purge_todate, #style\\
            do tmmdcal
    
680.6IOSG::MAURICEDifferently hirsuteFri Aug 20 1993 09:377
    HI,
    
    The third parameter to date_convert must be a number, not a symbol.
    
    Cheers
    
    Stuart
680.7thanks in advance!ANGLIN::HARRISABicycles need seat beltsFri Aug 20 1993 17:0915
    thansk stuart.  that did it. in the APR2 book DATE_CONVERT is shown
    with a symbol in the 3rd position, that's why i tried it.
    
    when this site upgrades to V3.0 in a couple of weeks, TMMDCAL is no
    longer available. i should change the script to:
    i've added the next to last line.  do i need to do anything else?
    
    for profil with .user eqs "manager" do -
            get #cal_purge_fromdate = "1-jan-1990"\\
            date_convert #nbs_fromdate, #cal_purge_fromdate, 7\\
            get #cal_purge_todate = "1-jan-1991"\\
            date_convert #nbs_todate, #cal_purge_todate, 7\\
            get oa$function = "calendar purge"
    !       do tmmdcal
    
680.8IOSG::MAURICEDifferently hirsuteFri Aug 20 1993 17:468
    Hi,
    
    The FOR loop doesn't look right - it looks as if you'll purge the
    Manager's calendar many times, but nobody elses.
    
    Cheers
    
    Stuart
680.9ANGLIN::HARRISABicycles need seat beltsFri Aug 20 1993 18:597
    i'm just using the manager as a test. when i run it "for real", it'll
    be:
    	for profil with .maides nes "mail-list" ....
    
    
    ann
    	
680.10Can't find the DATE_CONVERT documentation bugIOSG::EDMONDSONEstne volumen in toga, an solum tibi libet me videre?Mon Aug 23 1993 10:2411
    >thansk stuart.  that did it. in the APR2 book DATE_CONVERT is shown
    >with a symbol in the 3rd position, that's why i tried it.
    
    
    Er, can you say what version your APR2 book is, please?  I'm looking at
    my Version 3.0 copy, and it shows a number.
    
    If you can show us where the doc bug is, we can fix it.
    
    Ro
680.11It's hiding!IOSG::MAURICEDifferently hirsuteMon Aug 23 1993 10:407
    Hi Ro,
    
    See the last example on P.226
    
    Cheers
    
    Stuart
680.12IOSG::EDMONDSONEstne volumen in toga, an solum tibi libet me videre?Mon Aug 23 1993 10:423
    Got it!  Thanks, Stuart.
    
    r