The DFHCSDUP COPY command

Copy resource definitions from one group to another group.

COPY syntax

Read syntax diagramSkip visual syntax diagramCopyGroup(groupname1)TO( groupname2)MergeAtomservice( name)Bundle( name)CONnection( name)CORbaserver( name)DB2Conn( name)DB2Entry( name)DB2Tran( name)DJar( name)DOctemplate( name)Enqmodel( name)File( name)Ipconn( name)JOurnalmodel( name)JVmserver( name)LIbrary( name)LSRpool( name)MApset( name)MQconn( name)MQMONitor( name)PARTItionset( name)PARTNer( name)PIpeline( name)PROCesstype( name)PROFile( name)PROGram( name)Requestmodel( name)Sessions( name)TCpipservice( name)TDqueue( name)TErminal( name)TRANClass( name)TRANSaction( name)TSmodel( name)TYpeterm( name)Urimap( name)Webservice( name)ReplaceFRomcsd(ddname)

Description

The COPY command copies resource definitions from groupname1 to groupname2. The group from which the resource definitions are to be copied (groupname1) can be on the primary CSD, or it can be on the CSD file specified by the FROMCSD parameter.

Using the DFHCSDUP COPY command, you can copy individual resource definitions, or all the resource definitions in the group. The resource definitions are copied to the group named on the TO parameter (groupname2) in the primary file. If this group already exists, the definitions from the source group (groupname1) are added to those already in the groupname2 group. If the group specified on the TO parameter does not already exist, a new group of that name is created.

When you use the DFHCSDUP COPY command to copy all the resource definitions in a group into another group, and the groups contain duplicate resource names, you must specify either MERGE or REPLACE to indicate how duplicates should be handled. If you specify MERGE, duplicate definitions in the TO group are not replaced. If you specify REPLACE, the definitions being copied replace those in the TO group. If you do not specify MERGE or REPLACE, and duplicates are found, the copy operation fails.

When you use the DFHCSDUP COPY command to copy an individual resource definition into another group, by default, if a duplicate definition exists in the TO group it is not replaced. If you specify REPLACE, the definition being copied replaces that in the TO group.

The DFHCSDUP output listing tells you which definitions were copied, and what happened if duplicates were found.

Generic naming in the COPY command

The DFHCSDUP COPY command accepts generic group names on the GROUP option and on the TO option, subject to the following rules:
  • The only generic character permitted on the COPY command is the asterisk (*) symbol, which must be at the end of the name.
  • The prefix length of groupname1 must be equal to or greater than the prefix length of groupname2. COPY GROUP(DFHCOMP*) TO(USRCMP*) is valid, but COPY GROUP(DFHCO*) TO(USRCOMP*) is not.

You can use the asterisk (*) symbol to copy from generically named groups to other generically named groups or from generically named groups to a specific group, as shown in Examples.

The DFHCSDUP COPY command does not accept generic names for individual resource definitions that you specify using one of the resource options.

Options

FRomcsd(ddname)
Specifies the ddname of the secondary CSD file from which you are copying the group groupname1.
Group(groupname1)
Specifies the name of the group to be copied. You can specify a generic name for the group by using an asterisk (*). The default action is to copy the whole group. Alternatively, you can specify one of the resource type options and name an individual resource definition of that type to be copied.
MErge
Specifies that if groupname2 already exists and duplicate definitions occur, the original definitions in groupname2 are preserved.
Replace
Specifies that if groupname2 already exists and duplicate definitions occur, the definitions in groupname1 replace those in groupname2.
resource(name)
Specifies the type and name of an individual resource definition whose attributes you want to copy. On the DFHCSDUP COPY command, you cannot use generic names for individual resource definitions.
To(groupname2)
Specifies the name of the group to which all the resource definitions, or the individual named resource definition, are copied. If you are copying from another CSD file, you can give this group the same name as the one you are copying from. You can specify a generic name for the group by using an asterisk (*).

Examples

The following example copies a group named GA001 to a group named GA002, which already exists, replacing any duplicate resource definitions with those in group GA001.
COPY GROUP(GA001) TO(GA002) REPLACE
The following example copies group GA003 to group GA004, but if any duplicate definitions occur, preserves the group GA004 definitions.
COPY GROUP(GA003) TO(GA004) MERGE
The following example copies all the CICS®-supplied groups to user-named groups with a prefix of USR, with the result that DFHOPER becomes USROPER, DFHSTAND becomes USRSTAND, and so on.
COPY GROUP(DFH*) TO(USR*)
The following example copies every group starting with ABCD to the group called NEWGROUP:
COPY GROUP(ABCD*) TO(NEWGROUP)
The following example copies a single resource definition from the CICSC1 group to the CICSC2 group:
COPY SESSIONS(L122) GROUP(CICSC1) TO(CICSC2)