CPYCHGMBR COPY CHANGED MEMBERS TAAMBRD |
The copy changed members command allows you to copy all of the
members from a file where the change date is greater than or equal to
a specified date. This can be useful for capturing which source
members have changed or to provide a backup similar to SAVCHGOBJ.
SAVCHGOBJ can only be used when the file is not open for update. If
a programmer is using SEU when SAVCHGOBJ is run, the file will not be
saved (unless 'save while active' is specified).
A typical command would be entered as:
CPYCHGMBR FROMFILE(LIBA/QCLSRC)
TOFILE(LIBB/QCLSRC)
CPYDATE(050101)
You can also name a CPYTIME (the default is 000000).
An option exists to copy based on the last change date found within
each source record.
Assume you have several programmers working during the day and you
want to backup the source changes which have occurred one or more
times per day. You could create a library for the backup source
files and have a CL program copy to these files using the CPYCHGMBR
command.
The CL program might look as follows:
DCL &DATE *CHAR LEN(6)
DCL &YYMMDD *CHAR LEN(6)
RMVM FILE(BACKUPSRC/QCLSRC) MBR(*ALL)
MONMSG MSGID(CPF7301) /* None copied */
RMVM FILE(BACKUPSRC/QRPGSRC) MBR(*ALL)
MONMSG MSGID(CPF7301) /* None copied */
RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE)
CVTDAT DATE(&DATE) TOVAR(&YYMMDD) TOFMT(*YMD) +
TOSEP(*NONE)
CPYCHGMBR FROMFILE(PAYROLL/QCLSRC) +
TOFILE(BACKUPSRC/QCLSRC) CPYDATE(&YYMMDD)
CPYCHGMBR FROMFILE(PAYROLL/QRPGSRC) +
TOFILE(BACKUPSRC/QRPGSRC) CPYDATE(&YYMMDD)
You would then follow the CL program with a SAVLIB command. The same
CL program could be run multiple times per day.
Command parameters *CMD
------------------
FROMFILE The qualified from file name to copy from. This
must be a source file. The library defaults to
*LIBL.
TOFILE The qualified to file name to copy to. The library
defaults to *LIBL.
FROMMBR The member name to copy. *ALL is the default. A
specific member or a generic member may also be
specified.
CPYDATE The date (specified in YYMMDD) format to use to
compare against the last change date in the source.
If the source change date is greater than or equal
to CPYDATE, the member is copied.
CPYTIME The time (specified in HHMMSS) of the member to
copy. The time is compared against the last change
time of the member. The default is 000000. A time
other than 000000 cannot be specified if
ACTLSTCHG(*YES) is specified (the individual source
statements only have the -Date of last change-).
ACTLSTCHG A *YES/*NO value that defaults to *NO. The *YES
entry requests that each source member be read and
the date of last change (as per the individual
source statements) be determined.
There are some cases where the SEU statement change
date is all zeros. In this case, it is not known
when the member was changed so it is considered to
be changed.
BLKSEUDAT Blank SEU date which defaults to *INCLUDE. This
parameter is intended for a further option if
ACTLSTCHG(*YES) is specified. It allows you to
determine if a blank SEU date (zeros exist in the
record) should be included or dropped. The default
is *INCLUDE. *DROP specifies to not copy those
members where there is no change date in any of the
statements in the member.
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system.
CVTMBRLST Convert member list
EDTVAR Edit variable
SNDCOMPMSG Send completion message
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
------ ----- --------- ---------- -----------
CPYCHGMBR *CMD TAAMBRD QATTCMD
TAAMBRDC *PGM CLP TAAMBRDC QATTCL
|
Added to TAA Productivity tools April 1, 1995