Previous Topic: SAME AS ClauseNext Topic: EDIT Clause


COPY Clause

Use the COPY clause to copy selected options from one entity-occurrence definition to another and to merge the copied options into the target definition. Options that exist within both entity definitions are not copied. The COPY clause is valid in any entity-type statement that supports the SAME AS clause.

Note: To use the COPY clause, the user must have authority to access the entity occurrence from which the definition is to be copied. The secured entity must allow the user a minimum of DISPLAY access through either a PUBLIC ACCESS clause or a REGISTERED clause.

Syntax: COPY Clause

►►─── COPy entity-option FROm entity-type-name  entity-occurrence-name ───────►

 ►─┬────────────────────────────────────┬─────────────────────────────────────►◄
   └─ Version is ─┬─ version-number ─┬──┘
                  ├─ HIGhest ────────┤
                  └─ LOWest ─────────┘

Parameters

COPy entity-option

Specifies the portion of the object entity definition to be copied. For the valid syntax options for each entity type, see Entity-Type Syntax.

FROm entity-type-name

Specifies the name of the source entity type; valid names are ELEMENT, FILE, MODULE, PROCESS, QFILE, TABLE, PROGRAM, RECORD, REPORT, TRANSACTION, SYSTEM, SUBSYSTEM, or USER.

entity-occurrence-name

Specifies the name of the existing entity occurrence from which the option is to be copied. DDDL makes sure that the entity occurrences specified (module, qfile, process, and table) are the same entity type. Source text prevents copying source text from one entity type to an unrelated entity type.

Version is

Qualifies nonunique entity-occurrence names.

Example

The following example adds programs STCKUPDT and INVCTRL to the dictionary. All modules associated with STCKUPDT are copied to INVCTRL. Because modules ONORD, REORD, and NEWORD exist in both programs, those modules are not copied.

add program stckupdt
     module used is onord language is assembler
     module used is reord language is assembler
     module used is neword language is assembler
     module used is stat language is assembler
     module used is recov language is assembler.

add program invctrl
     module used is reord language is assembler
     module used is onord language is assembler
     module used is neword language is assembler.

modify program invctrl
     copy modules from program stckupdt.

The DISPLAY statement lists the resulting definition for INVCTRL.

display program invctrl.
        *+   add
        *+   program name is invctrl
        *+   date created is   mm/dd/yy
        *+   prepared by j-user
        *+   module used is onord version is 1 language is assembler
        *+   module used is reord version is 1 language is assembler
        *+   module used is neword version is 1 language is assembler
        *+   module used is stat version is 1 language is assembler
        *+   module used is recov version is 1 language is assembler.