TAA Tools
CHKDBF        CHECK DATA BASE FILE                      TAADBFB

          ***** Note  that much  of the  function of  this command  has
          been  replaced by  the system  RTVMBRD  command.   You should
          use  RTVMBRD if it supports  the parameter you want returned.

The CHKDBF command  checks a file to  see if it  can be used in  either
arrival or  keyed sequence and  if the user  is authorized to  read the
file.  Any error message IDs are returned as escape messages.

The CHKDBF command also supports optional parameters to return:

      - The library where the file was found
      - The member name being processed
      - Whether it is a source or data file
      - Whether it is a physical or logical file
      - The number of records in the member
      - The record length of the file
      - The number of physical members in the file
      - The type of ODP
      - The type of access path
      - Whether duplicate keys are allowed

A  typical use of  the command is to  check if a  file can be processed
in arrival sequence.  You would specify::

             CHKDBF     FILE(&LIB/&FILE)
             MONMSG     MSGID(CPF4247) EXEC(DO) /* Not arrival seq */
              .
              .

The following are typical  of the types of  errors found by CHKDBF  and
the message IDs to monitor for:

     - CPF5053   Not a data base file
     - CPF4133   Not a data base file
     - CPF4101   No file
     - CPF4102   No member
     - CPF4247   PROCESS(*ARRIVAL) was requested and arrival not valid
     - CPF5149   PROCESS(*KEYED) was requested and keyed not valid
     - CPF4236   Not authorized to open the member
     - CPF5134   Not authorized to read data

Another typical  use is to  check for the number  of records in  a file
such as:

             CHKDBF     FILE(&LIB/&FILE) NBRRCDS(&NBRRCDS)
             IF         (&NBRRCDS *EQ 0) DO /* No records routine */
             .
             .

If  there  are no  records in  the  member, the  command  will complete
normally.

The command operates like  RTVJOBA to allow one  or more parameters  to
be returned.

If an escape message  occurs, some of the return variables  will not be
set.

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

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

   MBR           The  member to be  processed.  The  default is *FIRST.

   PROCESS       The processing  of the  file requested.   *ARRIVAL  is
                 the default  meaning to try and read  the first record
                 in  the  file  in  arrival  sequence.    If *KEYED  is
                 specified,  a  random  access  occurs  via  a   single
                 character  blank key.    If no  record  is found,  the
                 MSGID  from the  system is blanked  (i.e.   the CHKDBF
                 command will complete normally).

   RTNLIB        An optional  return  variable for  the  library  where
                 the  file was  found.    This  information may  be  of
                 value  if *LIBL  was used  for the  library qualifier.
                 This must be a 10 byte character field.

   RTNMBR        An  optional  return variable  for  the member  of the
                 file that  was opened.    This information  may be  of
                 value  if  *FIRST  was  used for  the  MBR  parameter.
                 This must be a 10 byte character field.

   SRCFILE       An  optional return variable  of a  one byte character
                 field containing Y if the  file is a source file or  N
                 if it is a data file.

   FILETYPE      An optional  return variable  of a one  byte character
                 field  containing P for  a physical  file and L  for a
                 logical.

   NBRRCDS       An optional return variable  of the number of  records
                 in the  file.   This must  be specified  as a  decimal
                 field  with 11  digits and  0 decimals.   If  the file
                 cannot  be  opened successfully  (e.g.   it  is  not a
                 data base file), this field will contain zeros.

   RCDLEN        An optional  return variable of  the record length  of
                 the file.   This must be specified as  a decimal field
                 with  5 digits and 0 decimals.   If the file cannot be
                 opened successfully  (e.g.   it  is  not a  data  base
                 file), this field will contain zeros.

   NBRPHYS       An optional  return variable  of the  number of  based
                 on  physical members.   This  must  be specified  as a
                 decimal field with  5 digits  and 0 decimals.   If  it
                 is a physical file, this field will always be 1.

   ODP           An  optional return  variable of  the  ODP (Open  Data
                 Path)  type.   This  must  be specified  as  a 2  byte
                 character  field.  The codes are  DB = Data Base, DS =
                 Device file  (if  the file  can be  opened)  and SP  =
                 Spool.

   ACCESS        An optional  return variable of the  file access type.
                 This  must be specified  as a 2  byte character field.
                 The codes are KU =  Keyed unique, KF = Keyed FIFO,  KL
                 = Keyed LIFO, AR = Arrival.

   DUPKEYS       An  optional   return  variable  which   describes  if
                 duplicate  keys are allowed.   This  must be specified
                 as a  1 byte  character  field.   The  codes are  D  =
                 Duplicates  allowed and  U  = Duplicates  not  allowed
                 (unique).

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

The following TAA Tools must be on your system:

        HLRMVMSG      HLL Remove message

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

None, the tool is ready to use.

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

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

   CHKDBF        *CMD                      TAADBFB        QATTCMD
   TAADBFBC      *PGM          CLP         TAADBFBC       QATTCL
   TAADBFBR      *PGM          RPG         TAADBFBR       QATTRPG
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top