CMPDBF2 COMPARE DATA BASE FILE 2 TAADBLP |
The Compare Data Base File 2 command compares two identical format
unique keyed files and lists the changes to the data for a specific
field name. CMPDBF2 allows you to make a periodic copy of a uniquely
keyed file and then compare the current version against the last
copied version to see the changes for a specific field.
A typical command would be:
CMPDBF2 FROMFILE(FILEA) TOFILE(xxx/FILEA)
CMPFLD(FLD4)
Both files must have the same format and have the same unique key
description.
By default, a spooled file would be displayed identifying by key the
records that have changed for FLD4 in the To file. If a From key
does not exist in the To file, the exception is noted. The spooled
file would be deleted when the display ends.
You can invert the files, run CMPDBF2 again, and determine what
records were deleted in the original From file.
Security considerations
-----------------------
Because the use of the OPNDBR command (part of the CLPDBR tool) with
LVLCHK(*NO) requires an *ALLOBJ user, the program TAADBLPC adopts the
QSECOFR profile. To check the authorization to the From and To file,
a CHKOBJ command is used with the TAA UNADOPT tool to ensure the user
of the command has *USE authority to each file.
CMPDBF2 escape messages you can monitor for
-------------------------------------------
None. Escape messages from based on functions will be re-sent.
CMPDBF2 Command parameters *CMD
--------------------------
FROMFILE The qualified name of the From file. It must be a
unique keyed file.
The library value defaults to *LIBL. A specific
library or *CURLIB may also be used.
TOFILE The qualified name of the From file. It must have
the same format as the From file and the same unique
key definition.
The library value defaults to *LIBL. A specific
library or *CURLIB may also be used.
CMPFLD The field to be compared in the From file to the To
file.
FROMMBR The member of the From file to be compared. The
default is *FIRST. A specific member name or the
special value *LAST may be used.
TOMBR The member of the From file to be compared. The
default is *FIRST. A specific member name or the
special value *LAST may be used.
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 files must have the same format and must have the the same
unique key description.
** The record length may not exceed 5000 bytes.
** The key length may not exceed 100 bytes.
** A maximum of 10 key fields may exist.
** The maximum length field that may be compared is 100 bytes.
** The compare field type must be character, variable length,
packed, zoned, or binary.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKOBJ3 Check object 3
CLPDBR CLP data base record
HLRMVMSG HLL Remove message
RSNLSTMSG Resend last message
RTVCOLHDG Retrieve column heading
RTVDBFA Retrieve data base file attributes
RTVFLDA Retrieve field attributes
RTVFLDARR Retrieve field array
RTVFMT Retrieve format
RTVKEYLST Retrieve key list
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
------ ---- --------- ---------- ----------
CMPDBF2 *CMD TAADBLP QATTCMD
TAADBLPC *PGM CLP TAADBLPC QATTCL
TAADBLPR *PGM RPG TAADBLPR QATTRPG
|
Added to TAA Productivity tools January 1, 2008