TAA Tools
SCNDBFFLD       SCAN DATA BASE FIELD                   TAADBMN

The Scan Data  Base Field command  allows a scan  of a field in  a data
base  file for *EQ,  *LE, ...   *CT  (contains).  Up  to 3  fields that
help  identify  the  record where  a  match  was found  may  be listed.
SCNDBFFLD provides a simple query of data.

A typical command would be:

             SCNDBFFLD   FILE(xxx) FLDNAM(yyy) SCNVAL(ABC) OPER(*EQ)
                           IDFLD(zzz)

The file would be scanned for  any ABC values in the named field.   The
IDFLD  described  would appear  on  the left  of  the  listing to  help
identify  the records  where  the value  was found.   The  values found
that  match the  criteria  would  appear  on  the  right  side  of  the
listing.  The default is to display the results.

The file must  be a physical data  file with a record  length less than
9999 bytes.

The  fields named must be  of type A=Character,  P=Packed, or S=Signed.
Character fields may  not exceed  500 bytes.   Decimal  fields may  not
exceed 15 digits.

SCNDBFFLD escape messages you can monitor for
---------------------------------------------

      TAA9892    No values were found

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

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

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

   FLDNAM        The field in the file to be scanned.

                 The  field must  be of type  A=Character, P=Packed, or
                 S=Signed.    Character  fields  may  not   exceed  500
                 bytes.  Decimal fields may not exceed 15 digits.

   SCNVAL        The value to scan for.

                 Up to  20 bytes may be  entered.  If the  FLDNAM field
                 is  character, both the  scan value and  the data will
                 be folded to upper case before comparing.

                 If the  field is  decimal and  has decimal  positions,
                 the  value   should  be  entered  without   a  decimal
                 notation.   For example,  to scan for  2.23 enter 223.

   OPER          The operator to be used for  the compare.  *EQ is  the
                 default.  *NE,  *GT, *LT, *GE, *LE, or  *CT (contains)
                 may  be specified.   *CT is  only valid  for character
                 fields.

   IDFLD         A  list of up  to 3 fields which  will be printed with
                 each record  where the scan  value is  found.  If  you
                 have a unique  key to the file, the  unique key fields
                 should be specified to help identify the record.

                 The  default is  *PROMPT  in which  case a  subfile is
                 displayed  of  all  the  fields  in  the  file  and  a
                 selection may  be made.   A typical solution  is enter
                 an  'X' to  select the fields  needed to  identify the
                 record (up to 3 fields  may be selected).  When  Enter
                 is  pressed,  the   display  is  refreshed   with  the
                 selected  fields at the  top.   When Enter  is pressed
                 again  with no changes,  the command begins operation.

                 Only the first 15 positions of the ID field print.

   MBR           The member to be  scanned.  *FIRST is the default.   A
                 specific member name or *LAST may be specified.

   OUTPUT        How  to output  the  results.   *  is  the default  to
                 display  the spooled  file if  the command  is entered
                 interactively.  The spooled  file is deleted after  it
                 is displayed.

                 If  the  command is  entered  in  batch or  *PRINT  is
                 specified,  the spooled  file is output  and retained.

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

The file must be a  physical data file with  a record length less  than
9999 bytes.

The fields named  must be of  type A=Character, P=Packed,  or S=Signed.
Character  fields may  not exceed 500  bytes.   Decimal fields  may not
exceed 15 digits.

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

The following TAA Tools must be on your system:

     CHKDBFMBR       Check data base file member
     EDTVAR          Edit variable
     EXTLST          Extract list
     EXTLST2         Extract list 2
     PMTFLD          Prompt field
     RGTADJVAR       Right adjust variable
     RSNLSTMSG       Resend last message
     RTVDBFA         Retrieve data base file attributes
     RTVFLDA         Retrieve field attributes
     RTVFLDARR       Retrieve field array
     RTVVALA         Retrieve value attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message

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

None, the tool is ready to use.

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

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

   SCNDBFFLD     *CMD                   TAADBMN       QATTCMD
   TAADBMNC      *PGM       CLP         TAADBMNC      QATTCL
   TAADBMNR      *PGM       RPG         TAADBMNR      QATTRPG
					

Added to TAA Productivity tools January 15, 2010


Home Page Up to Top