TAA Tools
CPYFOMIT        COPY FILE WITH OMIT                    TAADBLE

The  Copy  File  With Omit  command  copies  from  one  file/member  to
another  and  omits  records  with  specified  values in  a  designated
character  field.  The To  file/member (it may be  created) must have 0
records and  have the  same  definition as  the From  file.   The  From
file/member  must  not  have 0  records.    Up  to  150 values  may  be
specified to be omitted.

A typical command would be:

              CPYFOMIT      FROMFILE(xxx) TOFILE(yyy)
                              CMPFLD(FLD1) VALUES(AAA BBB CCC)

All  records would  be copied to  the To  file except  those where FLD1
has a value of AAA, BBB, or  CCC.  A spooled file would be output  with
summary information.

If blank values should be omitted, see the BLANKVALUE parameter.

CPYF omit capability

CPYF does  not have  an 'omit'  function.   It does  have an  'include'
function.    You can  do  an 'include'  based  on *NE,  but  you cannot
specify a series of  *NE ORed conditions and  get the desired  results.
Stringing together 'include' statements such as:

    If     FLDA  *NE    A   or
           FLDA  *NE    B   or
           FLDA  *NE    C

results  in  all  records  being  copied  because  any  value  in  FLDA
satisfies  at least  one  of the  'includes'  and the  record  would be

CPYFOMIT escape messages you can monitor for

      TAA9891    The From file/member has 0 records
      TAA9892    The To file/member does not have 0 records
      TAA9893    No records were omitted

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

Command parameters                                    *CMD

   FROMFILE      The  qualified  name of  the From  file.   The library
                 value defaults  to *LIBL.    *CURLIB or  a named  file
                 may also be used.

                 The  file/member  must  not  be  clear  (records  must

   TOFILE        The  qualified  name  of the  To  file.    The library
                 value defaults  to *LIBL.   *CURLIB  or  a named  file
                 may also be used.

                 The  file must  have the  same  Level ID  as the  From

                 The  file/member   must  be  clear  (no  records  must

   CMPFLD        The  field  to  compare  against.     It  must  be   a
                 character type field of 32 bytes or less.

   VALUE         The value to omit.   Up to 150 values  may be entered.
                 A value  may not exceed the length of  the field to be

                 Blanks   may  not  be   entered  (see  the  BLANKVALUE

                 If the data  base field contains  lower case, a  value
                 must be entered with surrounding quotes.

   BLANKVALUE    Whether to  omit or include records  with blank values
                 in the CMPFLD.

                 *INCLUDE  is the  default to  include blank  values in
                 the To file.

                 *OMIT may be specified to omit blank values.

   FROMMBR       The member of the From  file.  The default is  *FIRST.
                 A specific member name may be entered.

   TOMBR         The member  of the  To file.   The default  is *FIRST.
                 A  specific member  name may be  entered.   The member
                 must exist.

   CRTFILE       A *YES/*NO parameter  for whether the  file should  be

                 *NO is the default  to not create the file.   The file
                 must already exist.

                 *YES may  be specified to  create the file  if it does
                 not already exist.




The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     EDTVAR          Edit variable
     EXTLST          Extract list
     EXTLST2         Extract list 2
     HLRMVMSG        HLL Remove message
     RSNLSTMSG       Resend last message
     RTVDBFA         Retrieve data base file attributes
     RTVFLDA         Retrieve field attributes
     RTVFMT          Retrieve format
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message


None, the tool is ready to use.

Objects used by the tool

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

   CPYFOMIT      *CMD                   TAADBLE       QATTCMD
   TAADBLEC      *PGM       CLP         TAADBLEC      QATTCL
   TAADBLER      *PGM       RPG         TAADBLER      QATTRPG

Added to TAA Productivity tools July 15, 2006

Home Page Up to Top