Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

COPY-ELEMENT - Copy member

&pagelevel(5)&pagelevel

COPY-ELEMENT copies members and libraries one to one. The copied members may receive new member designations.

The following copy options are available:

  • copying one or more members in the same library

  • copying one or more members to a different library

  • Copy an entire library

Copying with WRITE-MODE=*SUBSTITUTE

Specifying WRITE-MODE=*SUBSTITUTE makes the copied member the only member in the target library with its type and name. Before copying the member into the target library, LMSCONV deletes all members having the same type and name as the target member.

Restrictions
  • The input library must not be the same as the output library.

  • If an error occurs during deletion, the statement is aborted.

 

Format

COPY-ELEMENT

ELEMENT = *LIBRARY-ELEMENT (...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...)



|


*ALL(...)



|



|

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|


<composed-name 1..64 with-under with-wild(132)>(...)



|



|

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|

,TYPE = *DEFAULT / *ALL / <alphanum-name 1..8 with-wild(20)>



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>

 

,TO-ELEMENT = *LIBRARY-ELEMENT (...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *BY-SOURCE (...) / <composed-name 1..132 with-under with-wildcard-constr>(...)



|


*BY-SOURCE(...)



|



|

VERSION = *DEFAULT / *BY-SOURCE / *UPPER-LIMIT /



|



|


<composed-name 1..52 with-under with-wildcard-constr>



|


<composed-name 1..132 with-under with-wildcard-constr>(...)



|



|

VERSION = *DEFAULT / *BY-SOURCE / *UPPER-LIMIT /



|



|


<composed-name 1..52 with-under with-wildcard-constr>



|

,TYPE = *BY-SOURCE / *DEFAULT / <alphanum-name 1..20 with-wildcard-constr>



|

,USER-DATE = *BY-SOURCE / *TODAY / <date 8..10 with-compl>

,WRITE-MODE = *DEFAULT / *CREATE / *REPLACE / *EXTEND / *SUBSTITUTE / *ANY

,DIALOG-CONTROL = *DEFAULT / *NO / *YES / *ERROR

Operands

ELEMENT = *LIBRARY-ELEMENT(...)

Specifications for the desired member designation.

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)
Specifies the library containing the members to be copied.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = <filename 1..54 without-vers>
Name of the library from which the members are to be copied.

LIBRARY = *LINK(...)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library.

ELEMENT = *ALL (...) / <composed-name 1..64 with-under with-wild(132)>(...)
Name of the member to be copied.

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /
<composed-name 1..24 with-under with-wild(52)>
Version of the member to be copied.

VERSION = *HIGHEST-EXISTING
The member with the highest existing version is copied.

VERSION = *UPPER-LIMIT
The highest possible version X'FF' in the library under the specified TYPE and name is copied.

VERSION = <composed-name 1..24 with-under with-wild(52)>
The text specified here is interpreted as the version designation.

TYPE = *DEFAULT / *ALL / <alphanum-name 1..8 with-wild(20)>
Type of the member to be copied. If the value is *DEFAULT and the current value set with MODIFY-DEFAULTS is *NONE, LMSCONV requires a type specification.

USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)
Date given by the user.

USER-DATE = *ANY
The member to be copied has any date.

USER-DATE = *TODAY
The member with the current date is copied.

USER-DATE = <date 8..10 with-compl>
The member whose date is entered explicitly in the form [YY]YY-MM-DD is copied.

USER-DATE = *INTERVAL(...)
All members lying in the specified interval are copied.

FROM = 1900-01-01 / <date 8..10 with-compl>
Beginning of interval.

TO = *TODAY / <date 8..10 with-compl>
End of interval.

CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)
Creation date of the member. For a description of the operands, see the USER-DATE operand of this statement.

MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)
Date of the last modification to the member. For a description of the operands, see the USER-DATE operand of this statement.

TO-ELEMENT = *LIBRARY-ELEMENT(...)
Specifies the destination and name under which the member is to be copied.

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)
Specifies the new library name or library to which the member is to be added.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = *BY-SOURCE
The member is copied to the library which contains the member being copied.

LIBRARY = <filename 1..54 without-vers>
Name of the library to which the file is to be copied as a member. If the library does not yet exist, it will be created.

LIBRARY = *LINK(...)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library.

ELEMENT = *BY-SOURCE(...) /
<composed-name 1..132 with-under with-wildcard-constr>(...)
Name that the new member is to receive.

ELEMENT = *BY-SOURCE(...)
The new name is the same as the old name.

VERSION = *DEFAULT / *BY-SOURCE / *UPPER-LIMIT /
<composed-name 1..52 with-under with-wildcard-constr>
Version that the new member is to receive.

VERSION = *DEFAULT
The default value *BY-SOURCE or the current value set MODIFY-DEFAULTS.

VERSION = *BY-SOURCE
The new member receives the same version as the original member.

VERSION = *UPPER-LIMIT
The highest possible version X'FF' is generated.

VERSION = <composed-name 1..52 with-under with-wildcard-constr>
The new member receives the version specified here.

ELEMENT = <composed-name 1..132 with-under with-wildcard-constr>(...)
Name of the new member to be added. It can also be entered using wildcards.

VERSION = *DEFAULT / *BY-SOURCE / *UPPER-LIMIT /
<composed-name 1..52 with-under with-wildcard-constr>
Version that the new member is to receive.
For a description of the operands, see above.

TYPE = *BY-SOURCE / *DEFAULT /
<alphanum-name 1..20 with-wildcard-constr>
Type that the new member to be added is to receive.

TYPE = *BY-SOURCE
The new member receives the same type designation as the original member.

TYPE = *DEFAULT
If the value is *DEFAULT and the current value set with MODIFY-DEFAULTS is *NONE, LMSCONV requires a type specification.

USER-DATE = *BY-SOURCE / *TODAY / <date 8..10 with-compl>
Date given by the user.

USER-DATE = *BY-SOURCE
The new member is given the same date as the source member.

USER-DATE = *TODAY
The current date is given.

USER-DATE = <date 8..10 with-compl>
The date must be specified in the form [YY]YY-MM-DD.

WRITE-MODE = *DEFAULT / *CREATE / *REPLACE / *EXTEND / *SUBSTITUTE / *ANY
Overwriting of a member having the same name. If the member does not exist under this name, it will be created as a new member.

WRITE-MODE = *DEFAULT
The default value is *CREATE (see below) or the current value set with MODIFY-DEFAULTS.

WRITE-MODE = *CREATE
The target member must not yet exist and is created as a new member.

WRITE-MODE = *REPLACE
The target member must already exist and is replaced.

WRITE-MODE = *EXTEND
The target member is extended if it already exists. Otherwise it will be created as a new member.

WRITE-MODE = *SUBSTITUTE
All members having the same type and name as the source member are deleted from the target library. The source member is then copied into the library.

WRITE-MODE = *ANY
The target member is replaced if it already exists. Otherwise it will be created as a new member.

DIALOG-CONTROL = *DEFAULT / *NO / *YES / *ERROR
This operand specifies whether or not the execution of the statement is carried out interactively with the user.
For more detailed information on dialog control, see the MODIFY-DEFAULTS statement.

DIALOG-CONTROL = *DEFAULT
The default value is *NO or the current value set with MODIFY-DEFAULTS..

DIALOG-CONTROL = *NO
All members are processed without dialog queries, i.e. without the user being able to take control.
Exception: If a member or a library is locked, LMSCONV inquires whether the attempt to access it shall be repeated.

DIALOG-CONTROL = *YES / *ERROR
See the description in the MODIFY-DEFAULTS statement .

Examples

Input library X contains the S-type member A/1. Output library Y contains the S-type member A/2. Following


//COPY-ELEM

ELEMENT= *LIB(LIB=X,ELEM=A,TYPE=S),-
TO-ELEMENT= *LIB(LIB=Y), WRITE-MODE=*SUBSTITUTE

member A/1 is then the only member of type S and name A existing in the output library. Member A/2 has been deleted.


All the members of a product version are located in input library X. These members are to be copied into an existing output library Y in such a way that, after the copying process is concluded, Y contains only the copied product version and no other version. This can be done with


//COPY-ELEM

ELEMENT= *LIB(LIB= X,ELEM= *,TYPE= *),-
TO-ELEMENT= *LIB(LIB= Y), WRITE-MODE=*SUBSTITUTE


Copy an entire library

Library lib1 is copied in its entirety and is given the name lib2. By specifying “*” for member and type, no knowledge is required of the members contained, i.e. all members are copied one to one to the newly created library lib2.


//COPY-ELEM

ELEMENT= *LIB(LIB=lib1,ELEM= *,VERSION= *,TYPE= *),-
TO-ELEMENT= *LIB(LIB=lib2)