The COPY-LIBRARY statement copies a library in its entirety, i.e. together with all its library, type and member attributes. The target library must either have FILE-STRUCTURE=NONE or not yet exist. The target library is given the library format corresponding to its value for BUFFER-LENGTH. The statement is thus suitable for converting a library format.
The file protection attributes of the source library can be taken from the target library. This means that the statement is suited for reorganizing libraries. The target library is logically identical with the original library and now occupies the smallest possible amount of disk space.
If an error occurs during processing of the COPY-LIBRARY statement (e.g. insufficient disk space), the target library is not complete.
Format
COPY-LIBRARY | ||||||||||||||||||||||||||||
|
Operands
LIBRARY = <filename 1..54 without-vers> / *LINK(...)
Copies the library with the specified name.
LIBRARY = <filename 1..54 without-vers>
Copies the library assigned by means of the name.
LIBRARY = *LINK(...)
Copies the library assigned by means of a link name.
LINK-NAME = <structured-name 1..8>
Link name of the library, which was declared with /ADD-FILE-LINK.
TO-LIBRARY = <filename 1..54 without-vers> / *LINK(...)
Specifies the target library.
TO-LIBRARY = <filename 1..54 without-vers>
Generates a library with the specified name.
TO-LIBRARY = *LINK(...)
Generates the library assigned by means of a link name.
LINK-NAME = <structured-name 1..8>
Link name of the library, which was declared with /ADD-FILE-LINK.
FILE-ATTRIBUTES = *STD / *BY-SOURCE
Attributes of the target library file.
FILE-ATTRIBUTES = *STD
The file attributes of the target library are not changed. New files will be generated with the default values defined by the file management system.
FILE-ATTRIBUTES = *BY-SOURCE
The file protection attributes of the source library are applied to the target library (analogous to /COPY-FILE ..,PROTECTION=*SAME).
Examples
Copy a library to an NK4 pubset
/start-lmsconv //copy-library library=lib,to-library=:nk4:lib //end
Set the initial NK4 library format
/add-file-link file-name=nk4lib,link-name=nk4,buffer-length=*std(2) /start-lmsconv //copy-library library=nk2lib,to-library=*link(nk4) //end
Reorganize a library with intermediate storage
/delete-file file-name=tolib /start-lmsconv //copy-library library=lib,to-library=tolib,file-attributes=*by-source //end /copy-file from-file=tolib,to-file=lib /delete-file file-name=tolib