TAA Tools
CHKDAT              CHECK DATE                             TAADATB

The CHKDAT  command  provides a  method of  performing some  validation
against a  date field.  Not  only must the date be  valid, but optional
parameters  allow  you  to perform  some  range checking  on  the value
entered.

A typical  command would  ensure that the  date entered  is within  365
days after today.

                 CHKDAT    DATE(&DATE) DAYLORNG(0)

The data must be entered in job format.

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

   DATE          The date  to be checked.   It must be  *CHAR LEN(6) in
                 job format (e.g.  MMDDYY).

   DAYLORNG      The  low range  in days  from the  current date.   For
                 example, if  the  date  should  not be  in  the  past,
                 enter 0.   The default is  -365 days meaning  the date
                 must  be within the last  year.  You may  also enter a
                 plus value.

   DAYHIRNG      The high range  in days  from the current  date.   For
                 example, if  the  date should  not be  in the  future,
                 enter  0.   The default  is  +365 days  meaning within
                 the  following  year.    You may  also  enter  a minus
                 value.

   CURYEAR       Check for current year  only.  It is a  *YES/*NO value
                 with  *NO as  the default.   If  *YES is  entered, the
                 operator  can only  enter  a date  that is  within the
                 current calendar year.

If the date fails  the validity testing, CPF9898  is sent as an  escape
message.   The message text is  varied to describe the  specific error.

The following  describes some examples where the  date to be checked is
in the variable  &DATE which  is a  6 position character  field in  job
date format.

       Check for  a  valid date  within a  range  of 365  days plus  or
       minus from the current date.

                 CHKDAT    DATE(&DATE)

       Check for  a valid date that must be  either today or within the
       last 7 days.

                 CHKDAT    DATE(&DATE) DAYLORNG(-7) DAYHIRNG(0)

       Check  for  a valid  date that  must be  tomorrow or  within the
       next 7 days.

                 CHKDAT    DATE(&DATE) DAYLORNG(+1) DAYHIRNG(+7)

       Check for a valid date within the current year.

                 CHKDAT    DATE(&DATE) CURYEAR(*YES)

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

The following TAA Tools must be on your system:

         ADDDAT        Add date
         SNDESCMSG     Send escape message

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

None, the tool is ready to use.

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

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

   CHKDAT        *CMD                      TAADATB        QATTCMD
   TAADATBC      *PGM          CLP         TAADATBC       QATTCL
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top