TAA Tools
CHKARAFLD       CHECK AREA CODE FIELD                  TAAPHNG

The Check Area Code Field  command checks a named field in  a data base
file for  a valid area  code.  Depending  on the field  type, different
lengths  are  valid.   Only the  area codes  provided by  the PRTARACDE
tool are supported (includes US, Canada, Caribbean, Samoa, etc).

A typical command would be:

             CHKARAFLD     FILE(ABC) FIELD(DEF) IDFIELD(GHI)

The field DEF in  file ABC would be checked  for a valid area code.   A
spooled  file would  be  output with  the name  of  ABC.   If  an error
occurred,  a  line  would  be  listed  identifying  the  record by  the
Relative Record  number  and  the value  of  the  ID Field  GHI.    The
invalid area code would be listed.

Valid field type and length combinations
----------------------------------------

Depending on the  field type and length, only  certain combinations are
valid.   In the  following chart, the  'nnn' field would  be checked as
the area code.

     Character type (See also the 'Partial field' section.

            3           nnn (An area code field)
           10           nnnxxxxxxx
           11           1nnnxxxxxxx
           12           nnn-xxx-xxxx
           13           1nnn-xxx-xxxx
           14           1-nnn-xxx-xxxx

     Zoned type

            3           nnn (An area code field)
           10           nnnxxxxxxx
           11           1nnnxxxxxxx

     Packed type (digit length is checked)

            3           nnn (An area code field)
           10           nnnxxxxxxx
           11           1nnnxxxxxxx

Partial field
-------------

For 'character'  fields  of lengths  10-14,  your data  base  may  also
include local  phone numbers  without area  codes.   For example,  your
data may have:

          nnn-xxx-xxxx
          xxx-xxxx

You may  specify PARTIALFLD(*BYPASS) to bypass those  records that have
trailing blanks in a 'character' field of 10-14 bytes.

The  default is *ERROR meaning all records  would be flagged if they do
not have valid area codes.

CHKARAFLD escape messages you can monitor for
---------------------------------------------

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

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

   FILE          The qualified  name of  the file  containing the  area
                 code.   The library value defaults to  *LIBL.  *CURLIB
                 or a specific library may also be entered.

   PHONEFIELD    The  field name  to be  checked.   The 'nnn'  value in
                 the following is considered to be the area code.

                 For 'character' fields the  length and format must  be
                 one of the following:

                      3   nnn
                     10   nnnxxxxxxx
                     11   1nnnxxxxxxx
                     12   nnn-xxx-xxxx
                     13   1nnn-xxx-xxxx
                     14   1-nnn-xxx-xxxx

                 For 'zoned' fields  the length and format  must be one
                 of the following:

                      3   nnn
                     10   nnnxxxxxxx
                     11   1nnnxxxxxxx

                 For 'packed'  fields the digit length  and format must
                 be

                      3   nnn
                     10   nnnxxxxxxx
                     11   1nnnxxxxxxx

   MBR           The  member  containing  the  data.    *FIRST  is  the
                 default.  A specific member may be named.

   PARTIALFLD    A special  value that  determines whether a  character
                 field  may contain  only partial  data.   For example,
                 some   character   fields  may   have  data   such  as
                 xxx-xxx-xxxx while others  have xxx-xxxx.  The  second
                 value  means  there is  no  area  code  and the  phone
                 number  is  local.    To  bypass  those  records where
                 trailing  blanks  exist  in  a  'character'  field  of
                 10-14 bytes, specify *BYPASS.

                 *ERROR is  the default  and must  be used  for 'zoned'
                 or  'packed' fields.  If  used for 'character' fields,
                 the data  must  include an  area  code or  the  record
                 will be considered in error.

                 *BYPASS  may  be  specified  to  indicate  that  if  a
                 'character'   field  has   trailing   blanks,   it  is
                 considered   a  local  phone   number  and  should  be
                 bypassed.

   BYPARACDE     A list of up  to 300 area codes that will  be bypassed
                 as being  valid.  For  example, you may have  9xx area
                 codes (pay per call) that are considered valid.

                 *NONE  is  the  default  meaning  all  area codes  are
                 checked.

   IDFIELD       The name of  the field  to help  identify any  records
                 that are listed as errors.

                 The  default  is  *NONE meaning  the  Relative  Record
                 number  of the  record in  error  is adequate  to help
                 correct the error.

                 Up to 3 field names may  be entered, but they must  be
                 'character'  field types.    Up to  20  bytes will  be
                 listed from each.

   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
------------

Only the  area  codes provided  by  the  PRTARACDE tool  are  supported
(includes US, Canada, Caribbean, Samoa, etc).

The  area  code field  data  must  match  one  of the  supported  field
type/length combinations.

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     EDTVAR          Edit variable
     EXTLST          Extract list
     EXTLST2         Extract list 2
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     PRTARACDE       Print area code
     RSNLSTMSG       Resend last message
     RTVFLDA         Retrieve field 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
   ------        ----    ---------      ----------    ----------

   CHKARAFLD     *CMD                   TAAPHNG       QATTCMD
   TAAPHNGC      *PGM       CLP         TAAPHNGC      QATTCL
   TAAPHNGR      *PGM       RPG         TAAPHNGR      QATTRPG
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top