TAA Tools
SBMTIMJOB2      SUBMIT TIME JOB 2                      TAAJOEB

The Submit  Time Job 2  command is  a front end  to SBMJOB that  allows
the same job  to be submitted multiple times for a  given day.  A start
and  end time must be specified as well  as a time interval in minutes.
When jobs  are  submitted, the  SBMJOB SCDDATE/SCDTIME  parameters  are
used.

A typical command would be:

             SBMTIMJOB2   CMD(xxx) STRHOUR(07) INTERVAL(30)
                            ENDHOUR(18) JOB(yyy)

A  total of  23 jobs  would be  submitted for  the current  date  at 30
minute  intervals.  The first  job would be scheduled  for 7:00 and the
last job at 18:00.

The start hour must  be greater than the current  time if the jobs  are
scheduled for  the current  day.  A  date in the  future may  be named.
Each use of SBMTIMJOB2 must be for a specific date.

Submitting the same set of jobs every day
-----------------------------------------

You can  use the system job  scheduler (WRKJOBSCDE) to set  up a job to
run every day.  It can issue the SBMTIMJOB2 command as required.

A good approach would  be to schedule  the job for  the first time  you
want to run  the function.  Specify SBMTIMJOB2  with STRHOUR(*CURRENT).
This will prevent  an error if the job scheduler  is busy or the system
is  not up and  the 'start hour'  exceeds the current  time of day when
the scheduled job runs.

Submitting a job at then ending time
------------------------------------

Assume you specify:

             SBMTIMJOB2   CMD(xxx) STRHOUR(20) ENDHOUR(21)

Three jobs would be submitted to run at:

          20:00
          20:30
          21:00

Note that if  the last proposed  time matches the  end time, the  final
job would be submitted.

Ending at the witching hour
---------------------------

Assume you specify:

             SBMTIMJOB2   CMD(xxx) STRHOUR(20) INTERVAL(60)

A job would be submitted to run at:

          20:00
          21:00
          22:00
          23:00

The 5th job  would be proposed to run at 24:00,  but SBMJOB will reject
a  time  of  24:00:00.   Rather  than  ignore the  5th  job,  a  job is
scheduled to run 23:59:59.

SBMTIMJOB2 escape messages you can monitor for
----------------------------------------------

None.  Escape messages from based on functions will be re-sent.

Command parameters                                    *CMD
------------------

   CMD           The command  to be  submitted.   Command prompting  is
                 supported.

   STRHOUR       The start hour  of the first SBMJOB.  A  value from 00
                 to  24  or the  special  value  *CURRENT (meaning  the
                 current hour/minute) may  be specified.   If  *CURRENT
                 is specified,  the  STRTIM value  must be  00 and  the
                 current time is used for the start minute.

   STRMIN        The start  minute of the  first SBMJOB.   A value from
                 00 to 59 may be specified.  The default is 00.

   INTERVAL      The  number  of  minutes  for each  interval.    If 30
                 minutes  is  specified  along  with   STRHOUR(08)  and
                 STRMIN(00),  the first  job  would start  at 8:00  and
                 the succeeding jobs at 8:30, 9:00, 9:30 etc.

   ENDHOUR       The  hour to end  at.   A value from  00 to  24 or the
                 special value *ENDOFDAY may  be specified.   *ENDOFDAY
                 means  hour 24  and  minute 00  (the  ENDTIM value  is
                 ignored).

                 Each  time a  job is submitted,  SBMTIMJOB2 determines
                 the  next  proposed  schedule  time.    If  the   next
                 proposed schedule  time is for  an end  hour/time that
                 that  exceeds the ENDHOUR  and ENDMIN values,  the job
                 is not scheduled and the command ends.

                 A  special  case  is  made  if  the  proposed  time is
                 calculated  to  be 24:00:00  and  you  have  specified
                 ENDHOUR(*ENDOFDAY).       Because    SBMJOB   prevents
                 24:00:00, 23:59:59 is used instead.

   ENDMIN        The  end  time.    A  value  from  00  to  59  may  be
                 specified.  The default is 00.

   DATE          The date the job is  to be scheduled.  The default  is
                 *TODAY.  Special  values *DAY1, *DAY2 ...   *DAY60 may
                 be  entered to  provide a date  from 1  to 60  days in
                 the future.   An  actual date  may be  entered in  job
                 format, but cannot be prior to the current date.

   JOB           The name of the  job to be scheduled.   The default is
                 *JOBD meaning  to use the  name provided for  the JOBD
                 parameter.

   JOBQ          The  name of  the job queue  to be used.   The default
                 is *JOBD  meaning to  use  the job  queue assigned  to
                 the job description in the JOBD parameter.

                 The system  provides the  QSYSNOMAX job queue  in QSYS
                 which  may be useful  when short running  jobs need to
                 be run when  scheduled rather than  waiting for a  job
                 slot to be made available.

   JOBD          The  qualified  name  of  the job  description  to  be
                 used.  The default is QBATCH in *LIBL.

Restrictions
------------

None.

Prerequisites
-------------

The following TAA Tools must be on your system:

     ADDDAT          Add date
     ADDTIM          Add time
     CHKOBJ3         Check object 3
     CVTTIM          Convert time
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   SBMTIMJOB2    *CMD                   TAAJOEB       QATTCMD
   TAAJOEBC      *PGM       CLP         TAAJOEBC      QATTCL
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top