This is only required/useful when using WAKEUP in combination with a WAKEUP file. And, the exec using WAKEUP must be celver enough to use CP SLEEP or alike to effectively pass midnight. Here's what I wrote about the problem in our RxServer HTML documentation. *Midnight Processing*<|---------------------------------------------------------------------->
Precautions must be taken to make WAKEUP safely pass midnight. This section explains why the WAKEUP-file contains 2 times the command *MIDNIGHT*. How does WAKEUP use its event file ?<|------------------------------------------> WAKEUP can only use one timer for all time bound events. So, before it can set the next wake-up time, it must check all events and select the first one to come. Then it calculates how long it can go to sleep to reach that time, and sets the timer accordingly. Each time our server executes the *WAKEUP*command, the file is read again to find the next event. In following example, all events run only once a day to ease the explanation. Remark as well that there is no need to have the records sorted on the time field. ALL 00:01:00 08/30/01 MIDNIGHT ALL 23:59:01 08/28/01 MIDNIGHT ALL 06:00:00 08/30/01 SCANMSGLOG ALL 20:00:00 08/29/01 EXEC VCMAINT CPYREXX The first three fields are important in this explanation. - Field 1, in this case, tells that all events must be executed every day. - Field 2 tells at what time of day it must be triggered. - Field 3 is updated by WAKEUP and indicates when it the event was triggered the last time. By checking this field, WAKEUP knows whether the event was already triggered today or still needs to be executed. For records that have to executed once a day, WAKEUP looks at fields 2 and 3: 1. If it is now later than the time of field 2: - if the date in field 3 is equal to today, then the event has already been executed. - if the field indicates an earlier day, then the event is triggered immediately to clear the backlog. 2. If the current time is earlier than the one in field 2, the event becomes a candidate for selection. This leads to one important aspect and some side effects. - WAKEUP will not detect the first event planned for next day, and if the last event for today has been executed, there is nothing anymore that will set the timer. Our server will thus only be woken up by other events than a timer interrupt. WAKEUP is very likely to miss the first event of the next day. Therefore, all servers using a WAKEUP file must have an event triggered closely to midnight, whereby the server can then enter a *CP SLEEP* to let midnight pass by. WAKEUP will then detect the records again, as a new day has arrived. For this reason, the server kernel has the function *MIDNIGHT*. When the server starts up, it checks whether this function is defined in the file, and insert the record if it is missing: ALL 23:59:01 08/28/01 MIDNIGHT 2008/7/2 Rich Greenberg <[EMAIL PROTECTED]>: > On: Tue, Jul 01, 2008 at 03:37:19PM -0500,Huegel, Thomas Wrote: > > } It all depends on what you want to do. > } In some cases you may not want to wait forever for a file that may never > arrive. > } So you put the timer in. > } If on the other hand the vm is totally driven by the arrival of a RDR > file, then there would be no reason to have a timer value. > > WAKEUP has (or used to have) a problem with midnight, so my wakeup execs > usually had: > > 'WAKEUP 23:59:57 (..........' > > if rc = timer pop > then 'CP SLEEP 5 SECS' > > loop back to wakeup > > -- > Rich Greenberg N Ft Myers, FL, USA richgr atsign panix.com + 1 239 543 > 1353 > Eastern time. N6LRT I speak for myself & my dogs only. VM'er since > CP-67 > Canines:Val, Red, Shasta & Casey (RIP), Red & Zero, Siberians > Owner:Chinook-L > Retired at the beach Asst > Owner:Sibernet-L > -- Kris Buelens, IBM Belgium, VM customer support