FIXDBFFLD       FIX DATA BASE FIELD                    TAADBMC

 The  Fix Data  Base  Field  changes a  character  field (or  an  entire
 record)  in   a  member  to  trim  leading   blanks,  remove  specified
 characters,  and translate characters.  A  single field may be used for
 selection.    FIXDBFFLD may  be  useful  when  data  is  received  from
 another system that contains unwanted characters.

 Only a user with all rights to the file may use FIXDBFFLD.

 A typical command would be:

              FIXDBFFLD   FILE(xxx) UPDFLD(yyy)
                            TRMLDGBLK(*YES)
                            RMVCHAR(XYZ)
                            FROMCHAR(#$) TOCHAR(@_)

 The UPDFLD  field name would  be checked for  each record in  the file.
 Leading  blanks would be trimmed  off (data is left  adjusted).  If the
 characters X, Y,  or Z are found,  they would be  removed and the  data
 shifted left.  If  a '#' character is found, it would  be translated to
 '@'.  If a '$' character is found, it would be translated to '_'.

 For  example, the following describes  a field value  before and after.

         Before    '   AYB#C'
         After     'AB@     '

 The completion message  will describe how  many records were  processed
 and how many were changed.

 The sequence of processing is:

        - Trim leading blanks
        - Remove characters
        - Translate characters

 FIXDBFFLD escape messages you can monitor for
 ---------------------------------------------

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

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

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

                  The  file must not  have null fields  defined and must
                  not exceed 5000 bytes of record length.

    UPDFLD        The name of  the field to  be updated.   It must be  a
                  character  field   of  1000   bytes  or  less.     For
                  externally described files, a field must be named.

                  The  special value *RCD may be  entered if the file is
                  not externally described.   All  positions within  the
                  record are subject to change.

    TRMLDGBLK     A  *YES/*NO value  for whether  leading blanks  should
                  be trimmed.

                  *NO is the default to not trim any leading blanks.

                  *YES  may be  specified to trim  leading blanks.   The
                  data is shifted to the left.

    RMVCHAR       The characters to be removed.

                  *NONE is the default to not remove any characters.

                  A list of up  to 50 characters may  be specified.   If
                  a character  is found,  the character  is removed  and
                  the data is shifted to the left.

                  A  leading  or  trailing  blank  is  not  valid.    An
                  embedded  blank is valid  such as '$ T'.   A hex value
                  may be entered such as X'40A2E9'

    FROMCHAR      The list of characters  to be translated from.   Up to
                  50 characters  may be entered.  The  From character is
                  translated   to  the  corresponding  position  in  the
                  TOCHAR parameter.

                  The FROMCHAR  value  may not  contain an  embedded  or
                  trailing blank.  Hex values may be entered.

                  The  FROMCHAR  and  TOCHAR  values must  be  the  same
                  length.

    TOCHAR        The  list of characters  to be  translated to.   Up to
                  50 characters may be entered.   The From character  is
                  translated  to  the  corresponding   position  in  the
                  TOCHAR parameter.

                  A  leading  or  trailing  blank  is  not  valid.    An
                  embedded   blank  is  valid.    A  hex  value  may  be
                  entered.

    MBR           The member  to be  processed.  *FIRST  is the  default
                  for the  first member  in the file.   A  specific name
                  or *LAST may be entered.

    SELFLD        The  field to  select.   The default is  *NONE meaning
                  all records in the file will be processed.

                  Any type  of  field  may  be specified.    Only  those
                  records selected by  the SELOP and SELVAL  values will
                  be processed.

                  Selection occurs via the use of OPNQRYF.

    SELOP         The selection operator.

                  *EQ is  the default which is  ignored if SELFLD(*NONE)
                  is used.  The other  boolean values may be entered  as
                  well as *CT (contains).

    SELVAL        The selection value.   Up to 20 bytes may  be entered.
                  If the  selection is on a blank  value, enter *BLANKS.


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

   **   Only a user with all rights to the file may use FIXDBFFLD.

   **   The file must not have null fields.

   **   The record length must be 5000 bytes or less.

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

 The following TAA Tools must be on your system:

      CHKOBJ3         Check object 3
      EDTVAR          Edit variable
      HLRMVMSG        HLL Remove message
      RSNLSTMSG       Resend last message
      RTVDBFA         Retrieve data base file attributes
      RTVFLDA         Retrieve field attributes
      RTVVALA         Retrieve value attributes
      SNDCOMPMSG      Send completion message
      SNDESCINF       Send escape information
      SNDESCMSG       Send escape message
      SNDJLGMSG       Send job log message

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

 None, the tool is ready to use.

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

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

    FIXDBFFLD     *CMD                   TAADBMC       QATTCMD
    TAADBMCC      *PGM       CLP         TAADBMCC      QATTCL
    TAADBMCR      *PGM       RPG         TAADBMCR      QATTRPG

Added to TAA Productivity Tools January 15, 2009


Home Page

Powered by AS/400Powered by AS/400 Last modified on July 15, 2010 © 1995, 2010 - Jim Sloan, Inc.