RTVDBFA         RETRIEVE DATA BASE ATTRIBUTES          TAADBHV

 The Retrieve Data  Base Attributes command retrieves  basic information
 about a data base file.

 A typical command would be:

              DCL         &FILETYPE *CHAR LEN(2)
              DCL         &TYPE *CHAR LEN(1)
               .
              RTVDBFA     FILE(xxx)  FILETYPE(&FILETYPE) TYPE(&TYPE)
              IF          ((&FILETYPE *EQ 'PF') *AND +
                            (&TYPE *EQ 'S')) DO /* Source PF */
               .

 The command uses the QDBRTVFD API.

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

    FILE          The  qualified file  name of  the  file.   The library
                  value   defaults  to  *LIBL.    *CURLIB  may  also  be
                  specified.

    RTNLIB        An optional  return  variable  that will  contain  the
                  library  name where  the file  was found.    The value
                  may  be  helpful if  the  file is  accessed  without a
                  specific library  name.   If specified,  the  variable
                  must be declared as *CHAR LEN(10).

    FILETYPE      An optional  return variable that will  contain either
                  PF  of  LF  for the  file  type.    If specified,  the
                  variable must be declared as *CHAR LEN(2).

    TYPE          An optional return variable  that will contain  either
                  D (data)  or  S (source)  for the  type of  file.   If
                  specified,  the  variable must  be  declared as  *CHAR
                  LEN(1).

    NBRFMTS       An  optional  return  variable that  will  contain the
                  number of  formats.  If  specified, the variable  must
                  be declared as *DEC LEN(5 0).

    ACCPTH        An optional  return variable that  will contain either
                  K  (Keyed)  or  A (Arrival)  for  the  type  of access
                  path.   If specified,  the variable  must be  declared
                  as *CHAR LEN(1).

    ACCPTHTYP     An optional return  variable that will contain  one of
                  the following:

                       AR     Arrival sequence
                       KC     Keyed with dup keys allowed in FCFO order
                                 FCFO = First changed, first out
                       KF     Keyed with dup keys allowed in FIFO order
                       KL     Keyed with dup keys allowed in LIFO order
                       KN     Keyed with dup keys allowed
                                 The order is not guaranteed
                       KU     Keyed with no dups allowed
                       EV     Embedded vector

                  If specified,  the variable must be  declared as *CHAR
                  LEN(2).

    ACCPTHTYPD    An optional  return  variable that  will  contain  the
                  description of  the type of  access path  as described
                  for   the  ACCPTH  parameter.     If   specified,  the
                  variable must be declared as *CHAR LEN(50).

    RECOVER       An  optional  return  variable that  will  contain the
                  value of  the  RECOVER  attribute for  how  an  access
                  path  will  be  rebuilt.    The  values  returned  are
                  *AFTIPL,  *NO, or  *IPL.   If specified,  the variable
                  must be declared as *CHAR LEN(7).

    LVLCHK        An optional return variable  that will contain  either
                  Y or N  for whether LVLCHK is specified  for the file.
                  If  specified, the variable must  be declared as *CHAR
                  LEN(1).

    SELOMT        An optional return variable  that will contain  either
                  Y or  N  for whether  the file  has select/omit  logic
                  (only  valid on  logical  files).   If  specified, the
                  variable must be declared as *CHAR LEN(1).

    NBROFKEYS     An  optional  return  variable that  will  contain the
                  number of  keys  specified for  a  keyed access  path.
                  If specified,  the variable  must be declared  as *DEC
                  LEN(3 0).

    MAXKEYLEN     An  optional  return variable  that  will  contain the
                  maximum key length used for  a keyed access path.   If
                  this is  a physical  file or  a single format  logical
                  file,  this  is the  key  length.   If  specified, the
                  variable must be declared as *DEC LEN(5 0).

    ALTCOLSEQ     An optional return variable that  will contain Y or  N
                  for whether  the keyed access  path uses  an alternate
                  collating sequence.   If specified,  the variable must
                  be declared as *CHAR LEN(1).

    MAINT         An   optional  return   variable  that   will  contain
                  *IMMED, *DLY, or  *REBLD for  the type of  maintenance
                  used  for a  keyed  access path.    If specified,  the
                  variable must be declared as *CHAR LEN(6).

    MAXMBRS       An  optional  return variable  that  will  contain the
                  maximum number of members specified  for the file.   A
                  character field is  used as *NOMAX or a  number may be
                  returned.     If  specified,  the   variable  must  be
                  declared as *CHAR LEN(6).

    NBROFMBRS     An optional  return  variable that  will  contain  the
                  number  of   members  defined  for   the  file.     If
                  specified,  the  variable  must  be declared  as  *DEC
                  LEN(5 0).

    WAITFILE      An  optional  return  variable that  will  contain the
                  WAITFILE attribute  for the file.   A character  field
                  is  used   as  *CLS,  *IMMED,  or  a   number  may  be
                  returned.     If  specified,  the   variable  must  be
                  declared as *CHAR LEN(6).

    WAITRCD       An optional  return  variable that  will  contain  the
                  WAITRCD attribute  for the  file.   A character  field
                  is  used  as   *NOMAX,  *IMMED  or  a  number  may  be
                  returned.    If  specified,   the  variable  must   be
                  declared as *CHAR LEN(6).

    EXTDSC        An optional return  variable that will  contain either
                  Y or  N for whether the file  is externally described.
                  If  specified, the variable must  be declared as *CHAR
                  LEN(1).

    ALWNULL       An optional return  variable that will contain  either
                  Y  or N  for  whether the  file  contains any  ALWNULL
                  capable  fields.  If  specified, the  variable must be
                  declared as *CHAR LEN(1).

    VARLEN        An optional return variable  that will contain  either
                  Y  or N  for whether  the file  contains any  variable
                  length  fields.   If specified,  the variable  must be
                  declared as *CHAR LEN(1).

    DATETIME      An optional return variable  that will contain  either
                  Y or  N for  whether the  file contains any  date/time
                  fields.    This   refers  to  system  known  date/time
                  fields  specified for the following  types L = Date, T
                  = Time,  Z =  Timestamp.  If  specified, the  variable
                  must be declared as *CHAR LEN(1).

    REUSEDLT      An optional  return variable that  will contain either
                  Y  or N for whether the  physical file is specified to
                  reuse deleted  record space.   A  value of  N will  be
                  returned  for  a  logical file.    If  specified,  the
                  variable must be declared as *CHAR LEN(1).

    ALWRD         An  optional return variable that  will contain either
                  Y or N for whether the  file will allow records to  be
                  read.   If specified,  the variable  must be  declared
                  as *CHAR LEN(1).

    ALWWRT        An optional  return variable that  will contain either
                  Y  or N for whether the  file will allow records to be
                  written.     If  specified,  the   variable  must   be
                  declared as *CHAR LEN(1).

    ALWUPD        An optional  return variable that  will contain either
                  Y  or N for whether the file  will allow records to be
                  updated.    This  is  the   value  for  ALWUPD.     If
                  specified,  the variable  must  be  declared as  *CHAR
                  LEN(1).

    ALWDLT        An  optional return variable that  will contain either
                  Y or N for whether the  file will allow records to  be
                  deleted.    This   is  the  value  for  ALWDLT.     If
                  specified,  the  variable must  be  declared as  *CHAR
                  LEN(1).

    NBRTRGS       An  optional  return  variable that  will  contain the
                  number of triggers specified  for a physical file.   A
                  value of  0 will be returned  for a logical file.   If
                  specified,  the  variable  must  be  declared as  *DEC
                  LEN(5 0).

    NBRCONS       An optional  return  variable that  will  contain  the
                  number of  constraints specified for a  physical file.
                  A  value of  0 will  be returned  for a  logical file.
                  If specified, the  variable must be  declared as  *DEC
                  LEN(5 0).

    MAXFIELDS     An  optional return  variable  that will  contain  the
                  maximum number  of fields in  any format.   If this is
                  a  physical  file  or a  single  format  logical file,
                  this  is  the number  of  fields  in  the  file.    If
                  specified,  the  variable  must  be declared  as  *DEC
                  LEN(5 0).

    MAXRCDLEN     An  optional  return variable  that  will  contain the
                  maximum record length (the  longest format).  If  this
                  is a  physical file or  a single format  logical file,
                  this  is   the  record  length.    If  specified,  the
                  variable must be declared as *DEC LEN(5 0).

    PFJRN         An optional return variable that  will contain Y or  N
                  if  the  physical  file is  journaled.    For  logical
                  files,  the value  will always  be  N.   If specified,
                  the variable must be declared as *CHAR LEN(1).

    ACCPTHJRN     An  optional return variable that  will contain Y or N
                  if the access  path is journaled.   If specified,  the
                  variable must be declared as *CHAR LEN(1).

    JOIN          An optional  return variable that will contain  Y or N
                  if  a logical file exists  and it is a  Join file.  If
                  specified, the  variable  must be  declared  as  *CHAR
                  LEN(1).

    DYNSLT        An optional return  variable that will contain  Y or N
                  if a  logical file exists and it  has a dynamic select
                  access path.    If  specified, the  variable  must  be
                  declared as *CHAR LEN(1).

    SAVDAT        An  optional return  variable  that will  contain  the
                  last  save date  of the  file  in the  format CYYMMDD.
                  If  specified, the variable must  be declared as *CHAR
                  LEN(7).

    SAVTIM        An optional  return  variable  that will  contain  the
                  last save time  of the file in the  format HHMMSS.  If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(6).

    RSTDAT        An optional  return  variable that  will  contain  the
                  last restore date  of the file in  the format CYYMMDD.
                  If  specified, the variable must  be declared as *CHAR
                  LEN(7).

    RSTTIM        An optional  return  variable that  will  contain  the
                  last restore  time of the  file in the  format HHMMSS.
                  If specified,  the variable must be  declared as *CHAR
                  LEN(6).

    TEXT          An  optional  return  variable that  will  contain the
                  text  description of  the  file.   If  specified,  the
                  variable  must be  declared  as *CHAR  LEN(50).   Note
                  that  for a multi-member  file, the use  of RTVDBFA to
                  retrieve the  text  is much  faster  than the  use  of
                  RTVOBJD.

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

 Because  the command  returns  values, it  can  only be  used  in a  CL
 program.

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

 The following TAA Tools must be on your system:

      CVTBYTBIT       Convert byte to bit
      SNDESCMSG       Send escape message

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

 None, the tool is ready to use.

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

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

    RTVDBFA       *CMD                   TAADBHV       QATTCMD
    TAADBHVC      *PGM       CLP         TAADBHVC      QATTCL

Added to TAA Productivity Tools April 1, 1995


Home Page

Last modified on March 10, 2014 © 1995, 2014 - TAA Tools, Inc.