HP3000-L Archives

November 2001, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Douglas Becker <[log in to unmask]>
Reply To:
Douglas Becker <[log in to unmask]>
Date:
Fri, 2 Nov 2001 18:11:51 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (149 lines)
For those who have MPEX and Security/3000 from VESOFT, here is a relatively
new feature we use (the option must be given in BACKG) associated with
STREAMX:

(NEW) SCHEDULING STREAMX JOBS TO REPEAT


Syntax:   :STREAM filename
                   [;REPEAT= [DAILY|WEEKDAYS|day of week[, ...] ]
                   [;WHENEVER= condition]
                   [;WHEN= condition]
                      [;CHECKEVERY= minutes| DAILY ]
                   [;MPE SCHED PARMS]

Examples:  These examples show how to...

   ...stream a job at a scheduled time each day:

       :STREAM MAINJOB ;REPEAT=DAILY ;AT=01:00

   ...stream a job several times each day (once each hour):

       :STREAM XPMAIL.MAILJOB.SYS;&
                WHENEVER=(BETWEEN(HPHOUR,6,17) and (HPMINUTE=0))

   ...stream a job once a month:

       :STREAM REPORT.JOB.SYS;WHENEVER=(hpdate=1);CHECKEVERY=DAILY

   ...stream a job if another job fails (aborts):

       :STREAM RECOVER.JOB.SYS; WHEN=JSCOUNT('POST,MGR.PAYROLL')=0


We have added additional keywords that STREAMX will recognize when using our
supplied UDC for STREAM/STREAMX.  These keywords allow you to schedule jobs
that repeat on a regular basis or when a particular event occurs.  If you
include any of the keywords ;REPEAT, ;WHEN or ;WHENEVER on a stream command,
STREAMX will schedule the job using the %BACKG ALARM task.  In addition to
using these keywords on the command line, they may be used in a STREAMX
::SETSCHEDULE command as well.

Jobs scheduled with a REPEAT, WHEN or WHENEVER condition are displayed by
the
MPEX %SHOWSCHED command as well as in a separate section of the MPEX %
SHOWJOB
command.  Jobs scheduled with just the MPE scheduling parameters of IN,
DAY, or
DATE do not show up in the %SHOWSCHED command (of course, the MPE and MPEX
SHOWJOB command will show scheduled jobs that do not repeat).  If you want
to
force all jobs to be submitted by our background task so they show up in the
%SHOWSCHED command (and in the same area of the %SHOWJOB command), set the
JCW
VESOFTDOALLSCHED to 1 before using the STREAM or STREAMX UDC.

For the ;REPEAT= option, you can use the keywords DAILY for every day of the
week, WEEKDAY for every "work" day (excludes Saturday and Sunday), a
specific
day of the week or a list of days.  For specific days, you need to supply at
least the first three letters of the each day you want the job streamed.

Ordinarily, when you use the ;REPEAT= keyword, you would also use ;AT= to
specify a particular time each day that the job should be streamed.  If you
use
;REPEAT= without ;AT=, the scheduled time for the jobs to repeat will be the
time of day that you issued the command.  So if you type:

    :STREAM SCHEDJOB;REPEAT=MON,WED,SAT

at 4:08 in the afternoon, then this job will be scheduled to execute at
4:08PM
on Monday, Wednesday and Saturday.

The keywords ;WHEN and ;WHENEVER are used to specify a condition that when
true
will launch the job.  ;WHEN is used to set up a single event jobstream --
when
the condition becomes TRUE, the job is streamed and deleted from the
scheduler.
;WHENEVER is used to set up a multiple event jobstream -- as long as the
condition is TRUE, the job will be launched.  To avoid streaming several
jobs
at once if the condition remains TRUE for a long time (e.g.  if the
condition
is based upon whether or not a particular user is logged on) STREAMX will
not
launch another copy of the job if the previous job is still active.

The STREAMX scheduler uses the %BACKG ALARM task to schedule, test and
submit
jobs, so the STREAMX parameter of ;CHECKEVERY has the same effect as the %
ALARM
parameter of ;CHECKEVERY.  This keyword causes the ALARM task to test the
condition less often -- after the condition is tested, the next CHECKEVERY
intervals are skipped before the condition is tested again.

In one of the examples above, the condition being tested is:

     BETWEEN(HPHOUR,6,17) and (HPMINUTE=0)

Since the default is to test the condition once each minute, this will be
TRUE
if the time of day is between 6:00 AM and 5:00 PM - AND - if the minute of
the
hour is 0 (every hour, "on the hour").  If you didn't care exactly WHEN
during
the hour that the job streams, but you want the job to be streamed AT LEAST
once each hour, you could use:

    :STREAM XPMAIL.MAILJOB.SYS;&
             WHENEVER=BETWEEN(HPHOUR,6,17);CHECKEVERY=60

To review, you would use:

   ;REPEAT and ;AT to repeat a job at a particular time every day of the
week
     or on specific days.

   ;WHEN to launch a job if and when a particular event occurs.

   ;WHENEVER to launch a job as long as the condition is true.

   ;CHECKEVERY to reduce the number of times the condition is tested each
day.

The current job schedule may be viewed using the %SEC SHOWSCHED command
(similar to MPEX's %SHOWALARM).  Jobs that are displayed in this list may be
removed with the %SEC ABORTJOB command, which is equivalent to %DELETEALARM.

-------------------------------------

We have two jobs scheduled to run every hour during certain hours of the
day:

%showsched
                                                          Last   -Days-
 #A Job Name                   Submitted By               Job #  SMTWRFA -
Time-
--- -------------------------- -------------------------- ------ ------- ---
---
  1 CSM777J,DBECKER.TECSUP     DBECKER.TECSUP             J141
      WHENEVER (BETWEEN(HPHOUR,5,21) AND (HPMINUTE = 7))
  4 CSM870J,DBECKER.TECSUP     DBECKER.TECSUP             J143
      WHENEVER (BETWEEN(HPHOUR,8,17) AND (HPMINUTE =25))

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2