TAA Tools

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

A typical command would be:

             DCL        &RTNDATE *CHAR LEN(7)

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.

                 *NEXT may be entered for the next calendar 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.

                 *NEXT may be entered for the next calendar year.

                 A value in the range of 1940 to 2039.


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

The  command  uses  RTVSOMDAT,  which  uses  CVTDAT  internally,  which
restricts the conversion of dates from 1940 to 2039.


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


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