COPY

Use a COPY statement to create one or more Optim™ objects that are exactly like existing objects that match the criteria, but have different names.

This statement also generates a report of the new objects in the Directory listing file.

COPY
  TYPE { ALL | AC | AD | CD | CM | ED | LT | PK | PR | R | RD | TM }
  FROM objectname
  TO objectname
  [ MODIFIEDBY modifiedby ]
  [ DESC desc ]
  [ REPLACE { NO | YES } ]  

Required Criteria Keywords

The keywords and operands in the COPY statement are:

TYPE
Type of objects to be copied. This keyword must be included in the COPY statement with one of the following:
ALL
Copy all objects.
AC
Copy all Archive Collections that match criteria.
AD
Copy all Access Definitions that match criteria.
CD
Copy all Compare Definitions that match criteria.
CM
Copy all Column Maps that match criteria.
ED
Copy all Environment Definitions that match the criteria.
LT
Copy all Legacy Tables that match criteria.
PK
Copy all Optim Primary Keys that match criteria.
PR
Copy all Column Map Procedures that match criteria.
R
Copy all Optim relationships that match criteria.
RD
Copy all Retrieval Definitions that match the criteria.
TM
Copy all Table Maps that match criteria.
FROM
Name identifying source objects to be copied. This keyword and objectname must be included in the COPY statement.
objectname
Specify as an explicit value or a pattern, using DB2® LIKE syntax. An ERROR condition occurs if a matching object is not in the Directory. If TYPE is ALL, the maximum number of levels allowed in objectname is two.
TO
Name identifying new objects. This keyword and objectname must be included in the COPY statement.
objectname
Specify as an explicit value or a pattern, using DB2 LIKE syntax. If TYPE is ALL, the maximum number of levels allowed in objectname is two. (You can change only the first two parts of an Access Definition name.)

Optional Criteria Keywords

MODIFIEDBY
TSO ID of the last person to modify the source objects.
modifiedby
Specify as an explicit value or a pattern, using DB2 LIKE syntax.
DESC
Case-sensitive description of the Optim objects.
desc
Specify as an explicit value or a pattern, using DB2 LIKE syntax. Delimit values that include blanks in single (‘ ') or double (“ ”) quotes.

Optional Replace Keyword

REPLACE
Action taken when the name of a new object (taken from the objectname operand for the TO keyword) matches the name of an existing object in the Directory.
NO
Do not replace.
YES
Replicate the object and replace any existing object of the same type with the same name.

If you do not use the REPLACE keyword, existing objects are retained.

Examples

The following are examples of the COPY statement usage:

  1. To replicate all Column Maps with names prefixed with “FOPDEMO” and name the new Column Maps using the prefix “FOPPROD,” replacing any existing Column Maps that have matching names, specify:
    COPY TYPE  CM  FROM  FOPDEMO.%  TO
       FOPPROD.%  REPLACE  YES
    
  2. To replicate all Access Definitions with names prefixed with “FOPDEMO” and created or last modified by WMD, specify:
    COPY TYPE  AD  FROM  FOPDEMO.%.%  TO
       FOPPROD.%.%  MODIFIEDBY  WMD