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 - Copy files

&pagelevel(5)&pagelevel

This statement is used to copy files between privated disks and pubsets. The description of the individual operands indicates whether the operand requires the TSOS privilege.

COPY                                                                                                                                              

FILE=name(...)


name(...)



|

NEW= *SAME / name / *PREFIX(...)



|


*PREFIX(...)



|



|

ADD= *NO / pfx



|



|

,REMOVE= *NO / pfx

,FROM= *PUBSET / *DEVICE(...)


*DEVICE(...)



|

VOLUME=vsn



|

,DEVICE-TYPE=device-type / STDDISK

,TO= *PUBSET(...) / vsn(...)


*PUBSET(...)



|

DISK-NUMBER= *ANY / <integer x..y>


vsn(...)



|

DEVICE-TYPE=device-type / STDDISK

,REPLACE-OLD-FILES= *DIALOGUE / *YES / *NO


FILE
Specifies the files to be copied.

FILE=name(...)
Specifies the files that are to be transcribed by means of a partially or fully qualified name. If no pubset ID is specified, the following applies:
The pubset ID is taken from the DECLARE-PUBSET statement if issued, or from the home pubset.

NEW
Specifies the new names to be given to the transferred files.

 

NEW=*SAME
The files are cataloged under the same name as specified in the FILE operand. *SAME must not be specified together with FROM=*PUBSET.

Example

If the file sequence A.B. is to be copied from the current BS2000 pubset to the target pubset (pubset ID from the DECLARE-PUBSET statement), the following statement must be used: COPY FILE=:<source-pubset>:A.B.(NEW=A.B.)

NEW=name
Fully/partially qualified name under which the file specified by FILE=name is to be cataloged. The name specified in FILE must also be fully/partially qualified.

NEW=*PREFIX(...)
Controls the addition or removal of prefixes when forming target file names.

ADD=*NO
No prefix is added to the target file name.

ADD=pfx
The prefix pfx is added to the name of the target file:
Source file: ABC, prefix: V21.0 becomes
Target file: V21.0.ABC

REMOVE=*NO
An existing prefix is not removed when forming the name of a target file.

REMOVE=pfx
An existing prefix is removed when forming the name of a target file.

Source file:

ZN.ABC, prefix: LG becomes

Target file:

ZN.ABC

Source file:

ZN.ABC, prefix: ZN becomes

Target file:

ABC

pfx can be up to 10 characters long. Neither the catalog ID nor the user ID may be used for pfx.

If both ADD and REMOVE are specified in the same statement, REMOVE is processed before ADD:

PREFIX ADD=V21.0,REMOVE=ZN

Source file:

ZN.ABC becomes

Target file:

V21.0.ABC

 

FROM
Specifies from where the files are to be transcribed.

FROM=*PUBSET
The files are to be transcribed from the pubsets that have just been imported.

FROM=*DEVICE(...)

VOLUME
The files are to be transcribed from private volumes.

VOLUME=vsn
Volume serial number of the private volume.

DEVICE-TYPE=device-type / STDDISK
When VOLUME is specified, the device type or the standard device type (STDDISK) must also be defined.

TO
Specifies to where the files are to be transcribed.

TO=*PUBSET(...)
If DECLARE-PUBSET has been specified, the files are transcribed to this pubset. Otherwise they are transcribed to the default pubset of the user.

DISK-NUMBER
This operand may only be specified by users with the TSOS privilege.

Specifies the disk on the SF pubset to which the files are to be transcribed. The operand is ignored for disks in an SM pubset.

DISK-NUMBER=*ANY
The files are to be transcribed to any disks within the SF pubset.

DISK-NUMBER=n
The files are to be transcribed to the disk denoted by n. (for “number of the disk in the pubset”, see the CREATE-VOLUME statement).

TO=vsn(...)
Volume serial number of the private disk to which the files are to be transcribed.

DEVICE-TYPE=device-type
Device type of the private disk.

DEVICE-TYPE=STDDISK
Default device type of the private disk.

 

REPLACE-OLD-FILES
Specifies the procedure to be followed if a file has already been cataloged under the same name.

REPLACE-OLD-FILES=*DIALOGUE
In interactive mode, the user receives a message and can decide whether or not the file is to be overwritten. In execution modes where there is no dialog with the user (e.g. batch processing), specifying *DIALOGUE has the same effect as *NO.

REPLACE-OLD-FILES=*YES
An already existing file is to be overwritten (at the same location if the FCB type is the same).

REPLACE-OLD-FILES=*NO
An already existing file is not to be overwritten.

Notes
  1. All the files required for the installation must be transcribed by means of the COPY statement.

  2. Job variables and file generation groups are skipped.

  3. The file attributes are taken from the source file.

  4. In the event of disk errors, processing of the current file for transcription is aborted; where possible, the system will then go on to the next file.

  5. A conversion of the file format is not possible.

  6. If, while copying, a file is to be read into a different ID (only possible under TSOS), this must be specified via the FILE operand NEW=name.