TAA Tools
RTVMTHDAT       RETRIEVE MONTH DATE                    TAADAUL

The Retrieve  Month Date command  allows a retrieval  of the date  in a
month  based on  a day  of the  week and  which week  is desired.   For
example,  you can determine  the date of  the 3rd Wednesday  of a given
month.

A typical command would be:

             DCL        &RTNDATE *CHAR LEN(7)
              .
             RTVMTHDAT  RTNDATE(&RTNDATE) DAYOFWEEK(*WED) WEEK(3)

The date (CYMD format) would  be returned for the 3rd Wednesday  of the
current month.

RTVMTHDAT escape messages you can monitor for
---------------------------------------------

      TAA9895    The date does not exist for the 5th week

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

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

   RTNDATE       The  date to  be returned  in  the CYMD  format.   The
                 variable must be declared as *CHAR LEN(7).

   DAYOFWEEK     The  day of the week.   It must be  one of *SUN, *MON,
                 *TUE, *WED, *THUR, *FRI, or *SAT.

   WEEK          The week  of the  month.   The default  is  1 for  the
                 first week.  It must be a value of 1 - 5.

   MONTH         The month to determine the date for.

                 *CURRENT is the default for the current month.

                 A value of 01-12 may be entered.

   YEAR          The year to determine the date for.

                 *CURRENT is the default for the current year.

                 A value in the range of 1928 to 2071.

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

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

The year must be between 1928 and 2071.

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

The following TAA Tools must be on your system:

     CHKLEAP         Check leap year
     RTVSOMDAT       Retrieve start of month date
     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
   ------        ----    ---------      ----------    ----------

   RTVMTHDAT     *CMD                   TAADAUL       QATTCMD
   TAADAULC      *PGM       CLP         TAADAULC      QATTCL
					

Added to TAA Productivity tools January 1, 2007


Home Page Up to Top