TAA Tools
VALDBF       VALIDATE DATA BASE FILE           TAADBFJ

The VALDBF  command validates  an externally  described data base  file
for the following:

  **   Valid numeric data exists in numeric fields

  **   DDS validity  checking specifications (e.g.   RANGE, VALUES) are
       met

The  command is designed  to operate in  batch.  It  extracts the field
level information of the named  file by using DSPFFD and then  uses the
information to validate the file.

See the FIXDECERR  command which will correct any  decimal data errors.

See  the  CHKDBFDAT command  to  check dates  in  a data  base  such as
ensuring all dates are in valid MMDDYY format.

A typical use of the command is:

      VALDBF    FILE(FILEX)

A second command (VALMNYDBF) is  available for validating all  physical
file members  in a file  or a library.   It would typically  be entered
as:

      VALMNYDBF   FILE(xxxx/*ALL)

A  spooled  file  is created  with  the  same name  as  the  file being
validated.   If  errors are  found,  the relative  record  number,  the
field name and the value of the field are printed.

When  VALMNYDBF is  used, a  spooled  file is  only  created for  those
members where errors are found.

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

  **   An externally described file must be specified.

  **   VALDBF   will  only  process   a  single  member   per  command.
       VALMNYDBF   can  process  a  multi-member  file.    Multi-format
       logical  files  cannot  be  used,  but  a  single  format/single
       member logical file can be validated.

  **   Floating point fields are bypassed.

  **   Character  or numeric  fields  greater than  15  in length  that
       have validity specifications are bypassed.

  **   If  a file  contains more  than 250 fields,  the excess  are not
       validated.

  **   Because the DSPFFD  output is  copied with  CPYSPLF, the  VALDBF
       function is  release dependent.  Only  the lower and  upper case
       English language  versions are supported.  If  the format of the
       DSPFFD output is  changed on a  subsequent release, the  program
       may need to be modified.

  **   VALMNYDBF  will bypass  any logical  files,  any physical  files
       with no  members or any physical members with  no data.  Because
       VALMNYDBF   uses   only   physical  files,   any   logical  file
       validation criteria is not checked.

Technique
---------

The  validation  data  is  not  all  provided  in  the  DSPFFD  outfile
function.   Therefore,  the  DSPFFD  output to  *PRINT  occurs and  the
spool file is copied to a data base file and then read.

If  your physical file does not  contain the proper validation criteria
(e.g.  VALUES test), you can:

  **   Modify the physical

  **   Create  a  logical  file  over  the  physical  and  specify  the
       validation  criteria in  the logical.   You  would then  specify
       the logical  as the input file for  VALDBF.  This technique will
       also allow  you  to specify  a  more restrictive  test  just  to
       check your  data.  For  example, you might  want to ensure  that
       no  salary  amount exceeded  $10,000  a  week.   This  technique
       cannot   be  used  with  VALMNYDBF  because  it  processes  only
       physical files.

The normal  use  of the  command  is to  build a  file  in QTEMP  which
contains  the output  of DSPFFD  including the  validation data.   This
file is used to validate the named data base file.

The  command  supports  an  option to  allow  the  file  of  fields and
validation  data  to  be  built  only.    This  does  not  perform  the
execution step.   For  some applications  it may  be desirable to  have
the validation data and the DSPFFD output in a file.

VALDBF command parameters                             *CMD
-------------------------

   FILE          The  qualified   file  name  to  be  validated.    The
                 library name defaults to *LIBL.

   MBR           The member  name  to be  validated.   The  default  is
                 *FIRST.

   PROCESS       Whether  to execute  or just  build  the output  file.
                 The default  is *EXEC to execute  the validation step.
                 *BUILD  may  be  specified to  just  build  the output
                 file which contains the validation data.

   VALFILE       The validation file  that is built  as the first  step
                 of  the command  processing function,  The default  is
                 VALF  in   QTEMP.    If  you  are  not  interested  in
                 retaining the  output  file, take  the default.    You
                 may name  a different  file regardless of  the PROCESS
                 parameter value.

   DLTSPLF       A  *YES/*NO  value  to  control  whether  the  spooled
                 output   should   be   retained   if   the   file   is
                 successfully validated.   The file is  always produced
                 and  will  not  be  deleted  if  errors  occur.    The
                 default  is *NO meaning the  spooled file will be left
                 in the output queue.

   SAMEFILE      A *YES/*NO value  used in conjunction  with VALMNYDBF.
                 *NO  is the default.   *YES  should be  specified when
                 you  are  processing  the 2nd  thru  Nth  member  of a
                 file.  *YES provides  better performance by using  the
                 information from the format of the first member.

VALMNYDBF command parameters                          *CMD
----------------------------

   FILE          The qualified file name to be validated.

                 *ALL  may be  specified  for the  file  name in  which
                 case  all  physical members  in  the  library will  be
                 checked.  This is a  slow running function and  should
                 be submitted to batch.   If *ALL is specified  for the
                 file, a library must be named.

                 If  a specific file  is named,  *LIBL may be  used for
                 the  library name.  The  purpose of this command would
                 be to validate  a multi-member  file instead of  using
                 VALDBF.

                 *ALLUSR  may  be specified  for  the  library name  in
                 which  case all user  libraries on the  system will be
                 validated.  This is a very long running function.

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

The following TAA Tools must be on your system:

          EDTVAR        Edit variable
          HLRMVMSG      HLL Remove message
          RTVSYSVAL3    Retrieve system value 3
          SNDCOMPMSG    Send completion message
          SNDESCMSG     Send escape message
          SNDSTSMSG     Send status message

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

None, the tool is ready to use.

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

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

   VALDBF        *CMD                      TAADBFJ        QATTCMD
   VALMNYDBF     *CMD                      TAADBFJ2       QATTCMD
   VALF          *FILE         PF          TAADBFJP       QATTDDS
   TAADBFJC      *PGM          CLP         TAADBFJC       QATTCL
   TAADBFJC2     *PGM          CLP         TAADBFJC2      QATTCL
   TAADBFJR      *PGM          RPG         TAADBFJR       QATTRPG
   TAADBFJR2     *PGM          RPG         TAADBFJR2      QATTRPG

Structure
---------

VALDBF     Cmd
  TAADBFJC   CL
    TAADBFJR   RPG
      TAADBFJP    PF
    TAADBFJR2  RPG
      TAADBFJP    PF

VALMNYDBF   Cmd
  TAADBFJC2   CL
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top