TAA Tools

 RTVFLDA         RETRIEVE FIELD ATTRIBUTES              TAADBHI

 The Retrieve  Field Attributes command  retrieves the  field attributes
 of a field in a physical file or a single format logical file.

 A typical command would be:

             DCL           &TYPE *CHAR LEN(1)
             DCL           &BYTLEN *DEC LEN(5 0)
             DCL           &TEXT *CHAR LEN(50)
              .
              .
             RTVFLDA       FILE(FILEA) FIELD(FIELD1) TYPE(&TYPE)
                              BYTLEN(&BYTLEN) TEXT(&TEXT)

 If  you  use  the  command  to  retrieve the  attributes  for  multiple
 fields,  you should  use the SETLR  parameter to  minimize the overhead
 of accessing the field information.

 If the field does not exist  in the file, TAA9897 is sent as  an escape
 message.

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

    FILE          The qualified  file name of  the data base file.   The
                  library  value  defaults  to *LIBL.    *CURLIB  may be
                  specified.  A physical file  or a logical file with  a
                  single format may be named.

    FIELD         The field name to access the attributes of.

    SETLR         How to  set LR  for the  RPG program  doing the  work.
                  The  default is *YES,  meaning that  each time RTVFLDA
                  is used,  the list  of fields  will be  accessed  from
                  the file.   There is  overhead to  create the list  of
                  fields.

                  *NO means  the the RPG  program returns, but  is still
                  active  and still  retains the  list of  fields inside
                  the program.   *NO should be  used when you are  going
                  to  use RTVFLDA  again to  access data  from  the same
                  file.

                  *IMMED   means  to   end   the  RPG   program  without
                  returning any  field  attributes.   A  field  must  be
                  specified, but no attributes will be returned.

    TYPE          An  optional return  variable  that  will contain  the
                  type  of  field.   The values  returned  correspond to
                  the entries made in DDS.   If specified, the  variable
                  must be  declared as  *CHAR LEN(1).   The values  will
                  be:

     P = Packed decimal
     S = Zoned decimal
     B = Binary
     F = Floating point
     A = Character
     L = Date type
     T = Time type
     Z = Timestamp
     H = Hexadecimal
     J = DBCS-only
     E = DBCS-either
     O = DBCS-open
     G = DBCS-graphics

    BYTLEN        An  optional  return variable  that  will contain  the
                  number  of bytes the  field takes in  the buffer.  For
                  character fields,  this  is  the field  length.    For
                  packed  fields this is  the length  in the  buffer and
                  not  the number of digits.  See  the DIGITS field.  If
                  specified, the  variable  must  be  declared  as  *DEC
                  LEN(5 0).

    DIGITS        An  optional return  variable  that  will contain  the
                  number  of  digits  if  the  field  is  some  form  of
                  numeric value.   If  specified, the  variable must  be
                  declared as *DEC LEN(2 0).

    DECIMALS      An  optional return  variable  that will  contain  the
                  number of  decimal positions for a numeric  value.  If
                  specified,  the  variable  must  be  declared  as *DEC
                  LEN(2 0).

    TEXT          An  optional return  variable  that will  contain  the
                  text  description of  the  field.   If specified,  the
                  variable must be declared as *CHAR LEN(50).

    BUFLOC        An  optional  return variable  that  will  contain the
                  starting location  of the  field in  the  buffer.   If
                  specified,  the  variable  must be  declared  as  *DEC
                  LEN(5 0).

    COLHD1        An  optional  return variable  that  will  contain the
                  first column  heading of  the  field.   If  specified,
                  the variable must be declared as *CHAR LEN(20).

    COLHD2        An  optional return  variable  that will  contain  the
                  second  column heading  of the  field.   If specified,
                  the variable must be declared as *CHAR LEN(20).

    COLHD3        An  optional  return  variable that  will  contain the
                  third column  heading  of the  field.   If  specified,
                  the variable must be declared as *CHAR LEN(20).

    INTNAME       An  optional return  variable  that  will contain  the
                  internal  name  of  the  field.    If  specified,  the
                  variable must be declared as *CHAR LEN(10).

    ALTNAME       An optional  return  variable that  will  contain  the
                  alternative  name of  the  field.   If specified,  the
                  variable must be declared as *CHAR LEN(30).

    REFFILE       An  optional  return variable  that  will  contain the
                  file used if the field  was defined by reference.   If
                  specified,  the variable  must  be declared  as  *CHAR
                  LEN(10).

    REFLIB        An  optional  return variable  that  will contain  the
                  library  used if  the field was  defined by reference.
                  If specified, the  variable must be declared  as *CHAR
                  LEN(10).

    REFFMT        An  optional return  variable  that  will contain  the
                  format  used if  the field  was defined  by reference.
                  If specified, the variable  must be declared as  *CHAR
                  LEN(10).

    REFFLD        An  optional return  variable  that  will contain  the
                  field  used  if the  field was  defined  by reference.
                  If specified, the variable  must be declared as  *CHAR
                  LEN(10).

    DATTIMFMT     An  optional return  variable  that will  contain  the
                  value  used to define  the format  of the field  if it
                  is  a date/time  field.   The value  will be  blank or
                  *MDY, *DMY,  *YMD, *JUL  *ISO, *USA,  *EUR, *JIS  *HM.
                  If specified,  the variable must be  declared as *CHAR
                  LEN(4).

    DATTIMSEP     An  optional  return variable  that  will  contain the
                  value used to define the  separator used if the  field
                  is  a date/time  field.   If  specified, the  variable
                  must be declared as *CHAR LEN(1).

    ALLOWNULL     An optional  return variable that will  contain a Y or
                  N to designate if the field  allows a null value.   If
                  specified,  the variable  must  be declared  as  *CHAR
                  LEN(1).

    VARLENFLD     An optional  return variable that will contain  a Y or
                  N  to designate if  the field is  variable length.  If
                  specified,  the variable  must  be declared  as  *CHAR
                  LEN(1).

    ALLOCLEN      An  optional return  variable  that  will contain  the
                  allocated  length  for  variable  length  fields.   If
                  specified, the  variable  must  be  declared  as  *DEC
                  LEN(5 0).

    EDTCDE        An  optional return  variable  that  will contain  the
                  edit  code assigned to  the field.   If specified, the
                  variable must be declared as *CHAR LEN(1).

    NBRVLDCHK     An optional  return  variable that  will  contain  the
                  number of  validity  checks specified  for the  field.
                  If  specified, the variable  must be declared  as *DEC
                  LEN(4 0).

    KBDSHIFT      An  optional  return  variable that  will  contain the
                  keyboard shift assigned to  the field.  If  specified,
                  the variable must be declared as *CHAR LEN(1).

    CCSID         An  optional return  variable  that  will contain  the
                  Code  Character Set  ID specified  for the field.   If
                  specified, the  variable  must  be  declared  as  *DEC
                  LEN(5 0).

    ORDNBR        An  optional return  variable  that  will contain  the
                  Ordinal  Number  of  the field  in  the  format.   For
                  example, the  9th  field  in  the  format  is  Ordinal
                  Number  9.    If  specified,   the  variable  must  be
                  declared as *DEC LEN(5 0).

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

 The  RTVFLDARR tool used  to access  the information has  a restriction
 of  operating on  physical files  or single  format logical  files that
 have 998 or less field names.

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

 The following TAA Tools must be on your system:

      RTVFLDARR       Retrieve field array
      SNDESCMSG       Send escape message

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

 None, the tool is ready to use.

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

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

    RTVFLDA       *CMD                   TAADBHI       QATTCMD
    TAADBHIC      *PGM       CLP         TAADBHIC      QATTCL
    TAADBHIR      *PGM       RPG         TAADBHIR      QATTRPG

Added to TAA Productivity Tools May 1, 1996


Home Page

Last modified on November 19, 2014 © 1995, 2014 - TAA Tools, Inc.