Previous Topic: The Copy StatementNext Topic: The Delete Statement


Copy Syntax

►►─ COPy ELEment ─ element-name ─┬──────────────────────────────┬─────────────►
                                 └─┬─ THRough ─┬─ element-name ─┘
                                   └─ THRu ────┘

 ►─┬─────────────────────┬─ FROm ─┬─ FILe ───┬─ dd-name ──────────────────────►
   └─ VERsion ─ version ─┘        └─ DDName ─┘

 ►─┬──────────────────┬─ ENVironment ─ env-name ─ SYStem ─ sys-name ──────────►
   └─ SITe ─ site-id ─┘

 ►─ SUBsystem ─ subsys-name ─ TYPe ─ type-name ─ STAge NUMber ─ stage-no ─────►

 ►─ TO ─┬─┬─ FILe ───┬─ dd-name ─────────────────────────────┬────────────────►
        │ └─ DDName ─┘                                       │
        ├─ DSName ─ dataset-name ─┬────────────────────────┬─┤
        │                         └─ MEMber ─ member-name ─┘ │
        └─ PATH ─ hfspath ─ HFSFILE ─ filename ──────────────┘

 ►─┬────────────────────────────────────────────────────────┬─────────────────►
   └─ WHERE ─ ¤ ─┬────────────────────────────────────┬─ ¤ ─┘
                 │                     ┌─ , ────┐     │
                 ├─ CCId ─┬─ EQ ─┬─ ( ─▼─ ccid ─┴─ ) ─┤
                 │        └─ = ──┘                    │
                 └─ ARChive ─┬─┤ DATE ├────┬──────────┘
                             ├─┤ FROM ├────┤
                             └─┤ THROUGH ├─┘

 ►─┬────────────────────────────┬─ . ─────────────────────────────────────────►◄
   └─ OPTions ─ REPlace member ─┘

Expansion of DATE

├── DATe ─┬─ EQ ─┬─ date ─┬────────────────────────┬───────────────────────────┤
          └─ = ──┘        └─ TIMe ─┬─ EQ ─┬─ time ─┘
                                   └─ = ──┘

Expansion of FROM

├── FROm ─ DATe ─┬─ EQ ─┬─ date ─┬────────────────────────┬────────────────────┤
                 └─ = ──┘        └─ TIMe ─┬─ EQ ─┬─ time ─┘
                                          └─ = ──┘

Expansion of THROUGH

├──┬─ THRough ─┬─ DATe ─┬─ EQ ─┬─ date ─┬────────────────────────┬─────────────┤
   └─ THRu ────┘        └─ = ──┘        └─ TIMe ─┬─ EQ ─┬─ time ─┘
                                                 └─ = ──┘
COPY ELEMENTS element-name

Indicates the element(s) you want to copy. Code the required syntax and enter the appropriate element name. In addition, you can use a name mask with the element name.

THROUGH (THRU) element-name

Indicates that you want to copy a range of elements, beginning with the element coded in the COPY ELEMENTS statement, up to and including the element specified in this statement. You can use a name mask with the element name. If you enter the THROUGH clause, however, you cannot enter a member name (in the TO clause).

VERSION version

Indicates the version of the element you want to copy. Acceptable values are 1-99.

You must code a full element name if you want to indicate a version number.

If you code the VERSION clause, it must follow the THROUGH clause.

FROM FILE (DDNAME) dd-name
ENVIRONMENT env-name
SYSTEM sys-name
SUBSYSTEM subsys-name
TYPE type-name
STAGE NUMBER stage-no

The FROM clause indicates the location of the element being copied. CA Endevor SCM uses both the FROM clause in an action and any preceding SET FROM clause to determine the "from" criteria for that action.

The FILE (DDNAME) portion of the clause is required. The file name indicates from which archive file the element is being copied. Enter this information first when coding the syntax.

You must specify an environment, system, subsystem, type, and stage number (either 1 or 2). The environment name must be explicit. You can use a name mask with the system, subsystem, type, and stage.

Entering a site ID is optional. This field further defines the location of the element being copied.

TO FILE (DDNAME) dd-name
DSNAME dataset-name
MEMBER member-name

The TO clause indicates the file or data set name to which the element is being copied. CA Endevor SCM uses both the TO clause in an action and any preceding SET TO clause to determine the "to" criteria for that action.

You must enter either a FILE, a DDNAME, or a DSNAME (enter one and only one). If you enter a FILE or DDNAME, be sure the appropriate JCL is coded.

Enter a member name if it differs from the element name specified in the COPY ELEMENTS clause. Remember that you cannot use a name mask with a TO field name.

If you do not enter a member name, CA Endevor SCM assumes that the element name and member name are the same.

WHERE

Use WHERE clauses to further qualify element selection criteria. CA Endevor SCM uses both the WHERE clause in an action and any preceding SET WHERE clause to determine the "where" criteria for that action.

WHERE CCID EQ/= ccid

Limits the processing to those elements that match one of the supplied CCIDs. You can use a name mask in this field.

If you need to select elements identified under more than one CCID, you can specify multiple CCIDs by enclosing the CCIDs with parentheses and separating them with commas. The CCIDs may extend over multiple lines if necessary.

The next examples illustrate the use of this clause.

Example 1: WHERE CCID EQ PROJ00V
Example 2: WHERE CCID  (PROJ001, PROJ002, PROJ004)
WHERE ARCHIVE

This clause allows you to select elements based on the date and, optionally, time that an element was archived. There are four possible forms for this clause:

WHERE ARCHIVE DATE mm/dd/yy [TIME hh:mm ]

This clause tells CA Endevor SCM to copy only those elements with this date, and optionally, time stamp.

WHERE ARCHIVE FROM DATE mm/dd/yy [TIME hh:mm ]

This clause tells CA Endevor SCM to copy all elements with a date and, optionally, time stamp on or after the specified date and time stamps.

WHERE ARCHIVE THROUGH DATE mm/dd/yy [TIME hh:mm ]

This clause tells CA Endevor SCM to copy all elements with a date and, optionally, time stamp earlier than and including the specified date and time stamp.

WHERE ARCHIVE FROM DATE mm/dd/yy [TIME hh:mm ] TH ROUGH DATE mm/dd/yy [TIME hh:mm ]

This clause tells CA Endevor SCM to copy only those elements with a date, and optionally, time stamps within the specified range. If you enter a time, you must enter the date with it.

OPTIONS REPLACE MEMBER

If the element you are copying exists in the target location, CA Endevor SCM rejects the request unless you code the REPLACE MEMBER option. Specify this option when you want to replace the existing member in the library.

Example: Copy SCL

This SCL copies the archived version of Payroll program "PAYRPT43" to a user data set. The input is taken from a DDname that refers to a data set that was created with the ARCHIVE action.

COPY ELEMENT 'PAYRPT43'
    		FROM DDNAME ARCHIVE
         		   ENVIRONMENT 'PROD'
         		   SYSTEM 'PAYROLL'
         		   SUBSYSTEM 'REPORTS'
         		   TYPE 'COBOL'
         		   STAGE NUMBER 1
    		TO DSNAME 'PAYROLL.SRCLIB' MEMBER 'PAYRPT43'
    		OPTIONS REPLACE MEMBER .