ADDTIM      ADD A TIME IN NUMBER OF SECONDS            TAATIMA

 In some  environments, it is  desirable to determine  a time N  seconds
 from the  current time.   The ADDTIM command  performs the calculations
 necessary  to add N seconds  to the current time  (or a specified time)
 and returns the new  time.  A beginning  date field is optional and  an
 ending date  is optional.   The command handles the  potential rollover
 of a new day, new month etc.

 The  command also allows  a negative number  of seconds to  be added to
 determine  a  previous  time.    This  can  be  of  value  if  you  are
 attempting to process  by a time value  and want all the  entries for N
 seconds prior to a specific time.

 The  following  describes  how  the  command  could  be used  with  the
 SNDTIMMSG TAA Tool command to send  a message two hours (7200  seconds)
 after the current time.

              DCL        &ENDDAT *CHAR LEN(6)
              DCL        &ENDHR *CHAR LEN(2)
              DCL        &ENDMIN *CHAR LEN(2)
              .
              .
              ADDTIM     NBRSECS(7200) ENDDAT(&ENDDAT) ENDHR(&ENDHR) +
                           ENDMIN(&ENDMIN)
              SNDTIMMSG  MSG('Do your thing now') HOUR(&ENDHR) +
                           MIN(&ENDMIN) DATE(&ENDDAT)

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

    NBRSECS       The  number of  seconds  to  be added  or  subtracted.
                  For  subtraction,  enter a  minus  number.    Up to  9
                  digits may be entered.

    ENDTIM        The  optional return  variable which  will contain the
                  new time  in the format  HHMMSS.   It must be  defined
                  as *CHAR LEN(6).

    ENDDAT        The optional  return variable  which will  contain the
                  new  ending date.   This  allows a  rollover to  a new
                  day.   It must  be defined  as *CHAR  LEN(6).   It  is
                  returned in *JOB format.

    ENDDAT2       The optional  return variable  which will  contain the
                  new  ending  date  in  CYMD  format.   This  allows  a
                  rollover to  a new  day.   It differs  from ENDDAT  in
                  that  a  century  value is  supported.    It  must  be
                  defined as *CHAR LEN(7).

    ENDHR         The  optional return variable  which will  contain the
                  new  ending  hour.    This  may  be  used  to simplify
                  processing.  It must be defined as *CHAR LEN(2).

    ENDMIN        The optional  return variable which  will contain  the
                  new  ending minute.    This may  be  used to  simplify
                  processing.  It must be defined as *CHAR LEN(2).

    BGNTIM        Specifies  a beginning time.   The  default is *CURTIM
                  meaning the current  system time.   If specified,  the
                  value should be entered as HHMMSS.

    BGNDAT        Specifies a  beginning date.   The default  is *CURDAT
                  meaning  the current system  date.   If specified, the
                  value must  be entered  in  system date  format  (e.g.
                  MMDDYY).

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

 The following TAA Tools must be on your system:

           ADDDAT      Add date

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

 None, the tool is ready to use:

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

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

    ADDTIM        *CMD                      TAATIMA        QATTCMD
    TAATIMAC      *PGM          CLP         TAATIMAC       QATTCL

Added to TAA Productivity Tools April 1, 1995


Home Page

Last modified on March 10, 2014 © 1995, 2014 - TAA Tools, Inc.