Syntax and options of the MERGECOPY control statement

The MERGECOPY utility control statement, with its multiple options, defines the function that the utility job performs.

You can create a control statement with the ISPF/PDF edit function. After creating it, save it in a sequential or partitioned data set. When you create the JCL for running the job, you can use the SYSIN DD statement to specify the name of the data set that contains the utility control statement.

Start of change

Syntax diagram

Read syntax diagramSkip visual syntax diagram MERGECOPY LISTlistdef-nameTABLESPACEdatabase-name.table-space-nameDSNUMALLDSNUMintegerCLONEWORKDDNSYSUT1WORKDDNddnameNEWCOPYNOCOPYDDNSYSCOPYCOPYDDN( ddname1, ddname2)COPYDDN(, ddname2)RECOVERYDDN( ddname3, ddname4)NEWCOPYYESCOPYDDNSYSCOPYCOPYDDN( ddname1, ddname2)COPYDDN(, ddname2)RECOVERYDDN( ddname3, ddname4)
End of change

Option descriptions

LIST listdef-name
Specifies the name of a previously defined LISTDEF list name that contains only table spaces. You can specify one LIST keyword per MERGECOPY control statement. Do not specify LIST with the TABLESPACE keyword. MERGECOPY is invoked once for each table space in the list. This utility will only process clone data if the CLONE keyword is specified. The use of CLONED YES on the LISTDEF statement is not sufficient.

The partitions or partition ranges can be specified in a list.

TABLESPACE database-name.table-space-name
Specifies the table space that is to be copied, and, optionally, the database to which it belongs.
database-name
The name of the database that the table space belongs to. The default value is DSNDB04.
table-space-name
The name of the table space whose incremental image copies are to be merged.

You cannot run the MERGECOPY utility on the DSNDB01.DBD01, DSNDB01.SYSUTILX, DSNDB06.SYSTSCPY, or DSNDB01.SYSDBDXA table spaces, because you cannot make incremental copies of those table spaces. Because MERGECOPY does not directly access the table space whose copies it is merging, it does not interfere with concurrent access to that table space.

DSNUM
Identifies the table space or a partition or data set within the table space that is to be merged. DSNUM is optional.
ALL
Merges the entire table space.
integer
Is the number of a partition or data set that is to be merged. The maximum is 4096.

For a partitioned table space, the integer is its physical partition number.

For a nonpartitioned table space, find the integer at the end of the data set name as cataloged in the VSAM catalog. The data set name has the following format, where y is either I or J, z is either 1 or 2, and nnn is the data set integer:
catname.DSNDBx.dbname.tsname.y000z.Annn

You cannot specify DSNUM and LIST in the same MERGECOPY control statement. Use PARTLEVEL on the LISTDEF instead. If image copies were taken by data set (rather than by table space), MERGECOPY must use the copies by data set.

CLONE
Indicates that MERGECOPY is to process only image copy data sets that were taken against clone objects. This utility will only process clone data if the CLONE keyword is specified. The use of CLONED YES on the LISTDEF statement is not sufficient.
WORKDDN ddname
Specifies a DD statement for a temporary data set or template, which is to be used for intermediate merged output. WORKDDN is optional.

ddname is the DD name. The default value is SYSUT1.

Use the WORKDDN option if you are not able to allocate enough data sets to execute MERGECOPY; in that case, a temporary data set is used to hold intermediate output. If you omit the WORKDDN option, you might find that only some of the image copy data sets are merged. When MERGECOPY has ended, a message is issued that tells the number of data sets that exist and the number of data sets that have been merged. To continue the merge, repeat MERGECOPY with a new output data set.

NEWCOPY
Specifies whether incremental image copies are to be merged with the full image copy. NEWCOPY is optional.
NO
Merges incremental image copies into a single incremental image copy but does not merge them with the full image copy.
YES
Merges all incremental image copies with the full image copy to form a new full image copy.
COPYDDN (ddname1,ddname2)
Specifies the DD statements for the output image copy data sets at the local site. ddname1 is the primary output image copy data set. ddname2 is the backup output image copy data set. COPYDDN is optional.

The default value is COPYDDN(SYSCOPY), where SYSCOPY identifies the primary data set.

The COPYDDN keyword specifies either a DD name or a TEMPLATE name specification from a previous TEMPLATE control statement. If utility processing detects that the specified name is both a DD name in the current job step and a TEMPLATE name, the utility uses the DD name.

RECOVERYDDN (ddname3,ddname4)
Specifies the DD statements for the output image copy data sets at the recovery site. You can have a maximum of two output data sets; the outputs are identical. ddname3 is the primary output image copy data set. ddname4 is the backup output image copy data set. RECOVERYDDN is optional. No default value exists for RECOVERYDDN.

The RECOVERYDDN keyword specifies either a DD name or a TEMPLATE name specification from a previous TEMPLATE control statement. If utility processing detects that the specified name is both a DD name in the current job step and a TEMPLATE name, the utility uses the DD name.