TAA Tools
RTVNXTDAY       RETRIEVE NEXT DAY OF WEEK              TAADAUK

The  Retrieve Next  Day of  Week  command retrieves  the  date and  the
number of  days from a date  until a named weekday.   For example, what
is  the  date of  the next  Sunday.   The date  is returned  in CYYMMDD
format.

A typical series of commands would be:

              DCL          &NEWDAT *CHAR LEN(7)
               .
              RTVNXTDAY    NXTDAY(*SUN) STRDATE(*TODAY) NEWDAT(&NEWDAT)

If today is Friday 1050204,  the new date returned for Sunday  would be
1050206.   If today is Sunday  1050206, the new date  returned would be
1050213.

RTVNXTDAY escape messages you can monitor for
---------------------------------------------

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

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

   NXTDAY        The  day of  the week you  want the  day returned for.
                 The value must be *SUN, *MON ...  *SAT.

   STRDATE       The date to  start from.   The default is  *TODAY.   A
                 date in job date format may be entered.

   NEWDAT        The new date  to be returned in CYYMMDD  format.  This
                 is  an optional return  variable that if  used must be
                 specified as *CHAR LEN(7).

                 If today  is  Friday and  NXTDAY(*SUN)  is  requested,
                 the new date will be two days from now.

                 If  today is  Sunday  and NXTDAY(*SUN)  is  requested,
                 the new date will be one week from today.

   NBRDAYS       The number  of days between  the current date  and the
                 next  date.  This is  an optional return variable that
                 if used must be specified as *DEC LEN(1 0).

                 If  today is  Friday  and NXTDAY(*SUN)  is  requested,
                 the number of days returned will be 2.

                 If  today is  Sunday  and  NXTDAY(*SUN) is  requested,
                 the NBRDAYS returned will be 7.

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

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

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

The following TAA Tools must be on your system:

     ADDDAT2         Add date
     RTVDAT          Retrieve date
     SNDESCINF       Send escape information

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

None, the tool is ready to use.

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

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

   RTVNXTDAY     *CMD                   TAADAUK       QATTCMD
   TAADAUKC      *PGM       CLP         TAADAUKC      QATTCL
					

Added to TAA Productivity tools April 15, 2005


Home Page Up to Top