TAA Tools
ADDDAT3         ADD DATE 3                             TAADAUQ

The  Add Date  3  command  allows  a number  of  days  to be  added  or
subtracted from a  date and returns a new date.   ADDDAT3 is similar to
ADDDAT2,  but has been optimized for new dates  in the same year as the
input date.  The number of  days parameter is limited to -365  to +365.
Any date format may be input and output.

If  you  use the  ADDDAT  or  ADDDAT2  command repeatedly,  you  should
consider  changing to ADDDAT3 (the number of  days must be between -365
and + 365).

A typical series of commands would be:

             DCL        &RTNDATE *CHAR LEN(10)
              .
             ADDDAT3    FROMDATE(010109) FROMFMT(*MDY) +
                          TOFMT(*MDY) DAYS(+100) RTNDATE(&RTNDATE))

The RTNDATE value would be  '041109'.  Note that the RTNDATE  parameter
must be declared as *CHAR LEN(10).

Years between  1600 and 4000  are supported  as well as  accounting for
leap year dates.

The command  is optimized to return dates in the  same year as the year
of the DATE parameter.   For example, if  the DATE parameter  specifies
year 2009 and  the generated return date  is within the same  year, the
code does not have to check for leap years.

ADDDAT3 escape messages you can monitor for
-------------------------------------------

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

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

   FROMDATE      The  From  date in  the  format  as  described in  the
                 FROMFMT  parameter.   Years between 1600  and 4000 are
                 supported.

   FROMFMT       The format of  the FROMDATE parameter.   All supported
                 values as  on CVTDAT are  provided.  Use  the prompter
                 to see the supported values.

   RTNFMT        The  format of  the RTNFMT  parameter.   All supported
                 values as on  CVTDAT are provided.   Use the  prompter
                 to see the supported values.

   DAYS          The number  of days  to add  or subtract.   The  value
                 must be between -365 and + 365.

   RTNDATE       The  return  date.   The  format is  described  in the
                 RTNFMT parameter.


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

Because ADDDAT3 returns a variable, the  command may only be used in  a
CL program.

The DAYS parameter must be between -365 and +365.

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

The following TAA Tools must be on your system:

     CHKLEAP         Check leap year
     SNDESCINF       Send escape information

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

None, the tool is ready to use.

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

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

   ADDDAT3       *CMD                   TAADAUQ       QATTCMD
   TAADAUQC      *PGM       CLP         TAADAUQC      QATTCL
					

Added to TAA Productivity tools October 15, 2008


Home Page Up to Top