TAA Tools
CHKDBFMBR       CHECK DATA BASE FILE MEMBER            TAASRFF

The Check  Data  Base File  Member command  simplifies  checking for  a
data  base file  and authority  to it.    This provides  clear messages
when  the file or member does not exist,  the file is not the requested
file type, or the user does not have the proper authorization.

A typical series of commands would be:

             DCL       &RTNLIB *CHAR LEN(10)
              .
             CHKDBFMBR FILE(xxx) FILETYPE(*SRC) MBR(yyy) +
                         RTNLIB(&RTNLIB)

The xxx file would be ensured  to be a data base source file  and exist
on the library list.   The yyy member would be ensured  to exist and by
default the user must have *USE authority to the file.

MBR(*NONE) may be specified to check the file.

CHKDBFMBR escape messages you can monitor for
---------------------------------------------

      CPF3027    Not a data base file
      CPF9801    The file does not exist
      CPF9810    The library does not exist
      CPF9815    The member does not exist
      TAA9893    Authority failure
      TAA9894    The file type does not match the request
      TAA9895    The file attribute does not match the request

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

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

   FILE          The  qualified  name  of  the  data  base  file to  be
                 checked.   The library  value defaults  to  *LIBL.   A
                 specific library or *CURLIB may also be used.

   MBR           The  member to  be checked.   The  default is  *FIRST.
                 *LAST,  *NONE,  or  a specific  member  may  be named.
                 Using *NONE allows a check of the file.

   FILETYPE      The file type  to be  checked.  *ALL  is the  default.
                 *DATA or *SRC may be specified.

   FILEATR       The  file  attribute  to be  checked.    *ALL  is  the
                 default.   *PF (meaning  PF or  PF38) or  *LF (meaning
                 LF or LF38) may be specified.

   AUT           The  authority  to  be  checked.   Either  one  of the
                 single values *USE,  *CHANGE, *ALLMBR, or *ALL  may be
                 entered.    *USE,  *CHANGE  and  *ALL  have  the  same
                 meanings as used by the system.

                 *ALLMBR  should be used  to determine if  the user can
                 do typical operations against  a member such as  read,
                 add, update,  delete, add a  new member, and  clear an
                 existing  member.   This is the  same as  *CHANGE plus
                 *OBJMGT.   It  would  appear  on  DSPOBJAUT  as  'USER
                 DEF'.    *ALLMBR  does  not  include  the  ability  to
                 remove a  member.  If  the ability to  remove a member
                 should be checked, use AUT(*ALL).

                 A  list  of  individual authorities  may  be specified
                 including the same values  as supported by the  system
                 *OBJALTER,   *OBJEXIST,  *OBJMGT,   *OBJOPR,  *OBJREF,
                 *ADD, *READ, *DLT, and *UPD.

                 Note  that ALWDLT  and ALWUPD  functions which  can be
                 specified for  a  file are  not  checked by  *DLT  and
                 *UPD.

   RTNLIB        A  return parameter  for  the library  where the  file
                 was  found.    This is  an  optional  return parameter
                 that if used must be specified as *CHAR LEN(10).

   RTNMBR        A return  parameter  for  the  member  name  that  was
                 found.  This may  be helpful if the MBR  parameter was
                 *FIRST  or   *LAST.    This  is   an  optional  return
                 parameter  that  if used  must  be specified  as *CHAR
                 LEN(10).

   RTNFILTYPE    A return parameter for  the file type found.   It will
                 contain  either *DATA or  *SRC.   This is  an optional
                 return  parameter that  if used  must be  specified as
                 *CHAR LEN(5).

   RTNATR        A return  parameter for  the  attribute of  the  file.
                 It will  contain either PF, PF38,  LF, or LF38.   This
                 is an  optional return parameter that  if used must be
                 specified as *CHAR LEN(10).

   RTNFMT        A return parameter  for the format  name of the  file.
                 If a LF  has multiple physical files, the  format name
                 of the  first file is  returned.  This  is an optional
                 return  parameter that  if used  must be  specified as
                 *CHAR LEN(10).

   RTNRCDLEN     A return  parameter for the  record length.   This  is
                 an  optional return  parameter  that if  used must  be
                 specified as *DEC LEN(5 0).

   RTNFLDS       A  return parameter  for the  number of fields  in the
                 format.   This is  an optional  return parameter  that
                 if used must be specified as *DEC LEN(5 0).

   RTNLVLID      A return  parameter for  the level  ID of  the format.
                 This  is  an optional  return parameter  that  if used
                 must be specified as *CHAR LEN(13).

   RTNSRCTYPE    A return parameter for the  source type of the  member
                 if a  source  file was  found.   This  is an  optional
                 return  parameter that  if used  must be  specified as
                 *CHAR LEN(10).


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

Because  the  CHKDBFMBR  command returns  parameters,  the  command may
only be used in a CL program.

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

The following TAA Tools must be on your system:

     EXTLST2         Extract list 2
     RSNLSTMSG       Resend last message
     RTVFMT          Retrieve format
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   CHKDBFMBR     *CMD                   TAASRFF       QATTCMD
   TAASRFFC      *PGM       CLP         TAASRFFC      QATTCL
					

Added to TAA Productivity tools October 15, 2009


Home Page Up to Top