TAA Tools
CPYUNQKEY       COPY UNIQUE KEY RECORDS                TAADBLA

The Copy  Unique  Key Records  command copies  unmatched keyed  records
from one file  to another.  Both files must be  keyed and have the same
definition.    This allows  a merging  to occur  for  unique keys.   By
default, PROCESS(*CHK)  is used  to check  what the  results would  be.
An  optional  listing of  the  matched  and  unmatched records  may  be
specified.

An *ALLOBJ user is required.

Both files  must be keyed with the same key  fields, but do not have to
be specified as having unique keys.

A typical command would be:

             CPYUNQKEY     FROMFILE(ABCX) TOFILE(ABCY)

Since PROCESS(*CHK) is  the default, messages  would describe how  many
duplicates  were  found  and  how many  unique  keys  would  have  been
copied.

To copy the unique keys, specify:

             CPYUNQKEY     FROMFILE(ABCX) TOFILE(ABCY) PROCESS(*CPY)


CPYUNQKEY escape messages you can monitor for
---------------------------------------------

      TAA9891    No unmatched keys to copy
      TAA9892    No records in the From file
      TAA9893    No records in the To file

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

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

   FROMFILE      The  qualified name of  the From file  to copy records
                 from.  The library value  defaults to *LIBL.   *CURLIB
                 may also be used.

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

                 Both  the From  and To  files must  be keyed  with the
                 same key fields,  but do not  have to be specified  as
                 having unique keys.

   PROCESS       Whether to 'check only' or 'copy' the records.

                 *CHK  is  the  default  to provide  messages  of  what
                 would have occurred if *CPY had been requested.

                 *CPY  causes a copy from the From  file to the To file
                 for any unique keyed records.

   PRINT         Whether print the matched and unmatched records.

                 *NO is the  default, meaning  no listing would  occur.

                 *YES may be specified to output a listing.

   FROMMBR       The  member of  the From  file to  copy records  from.
                 No special value exists.

   TOMBR         The  member of  the To file  to copy  records to.   No
                 special value exists.

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

An *ALLOBJ user is required.

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

The following TAA Tools must be on your system:

     EDTVAR          Edit variable
     MOVCHRDEC       Move character to decimal
     OPNDBR          Open Data Base records
     PRINT           Print
     RTVDBFA         Retrieve data base file attributes
     RTVFLDA         Retrieve field attributes
     RTVFMT          Retrieve format
     RTVKEYLST       Retrieve key list
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   CPYUNQKEY     *CMD                   TAADBLA       QATTCMD
   TAADBLAC      *PGM       CLP         TAADBLAC      QATTCL
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top