COPY-FILE

File 37
Op-Sys z/OS, z/VSE , BS2000
Statement PROCESS
Task Copy files or library members. The copy operation can be done without restrictions, that is, across operating systems, with the exception of executable items (e.g., copying a z/OS load module to a z/VSE phase is prohibited). Both source and target files must exist before this function is executed.

z/OS: Load modules can only be copied from PDS to PDS, while program objects can only be copied from PDSE to PDSE. Mixing of PDS and PDSE formats is unavailable due to IBM restrictions.

BS2000: Copying to a BS2000 target can only be performed, if the target is locally available.


Common Fields for all Operating Systems

Dictionary Field Name F/L Mu DE Remarks
ERROR-CODE N3      
ERROR-TEXT A58      
NODE N5   D  
NODE-NAME A16   D  
SYSTEM-MESSAGE-CODE A10      
FROM-DSNAME A54   D Required
FROM-PRODUCT A1   D  
FROM-PASSWORD A8   D Not for z/VSE
TO-DSNAME A54   D Required
TO-PRODUCT A1   D  
TO-PASSWORD A8   D Not for z/VSE
REPLACE A3   D  

Additional Fields Supported for z/OS

Dictionary Field Name F/L Mu DE Remarks
ERROR-NODE N5      
ERROR-VIEW N3      
FROM-VOLSER A6   D  
FROM-TAPE-DDNAME A8   D  
FROM-TAPE-FILE-SEQUENCE B2   D  
FROM-USERID A8   D  
FROM-USER-PASSWORD A8   D  
FROM-MEMBER A8   D  
FROM-NODE N5   D  
TO-VOLSER A6   D  
TO-TAPE-DDNAME A8   D  
TO-TAPE-FILE-SEQUENCE B2   D  
TO-USERID A8   D  
TO-USER-PASSWORD A8   D  
TO-MEMBER A8   D  
TO-NODE N5   D  

Additional Fields Supported for z/VSE

Dictionary Field Name F/L Mu DE Remarks
ERROR-NODE N5      
ERROR-VIEW N3      
FROM-VOLSER A6   D  
FROM-TAPE-DDNAME A8   D  
FROM-TAPE-FILE-SEQUENCE B2   D  
FROM-USERID A8   D  
FROM-MEMBER A8   D  
FROM-NODE N3   D  
TO-VOLSER A6   D  
TO-TAPE-DDNAME A8   D  
TO-TAPE-FILE-SEQUENCE B2   D  
TO-USERID A8   D  
TO-MEMBER A8   D  
TO-NODE N3   D  
FROM-LIBRARY A8   D  
FROM-SUB-LIBRARY A8   D  
FROM-MEMBER-TYPE A8   D  
FROM-VSAM-CATALOG A7   D  
FROM-LRECL B2   D  
FROM-BLKSIZE B2   D  
FROM-RECFM A2   D  
TO-LIBRARY A8   D  
TO-SUB-LIBRARY A8   D  
TO-MEMBER-TYPE A8   D  
TO-VSAM-CATALOG A7   D  

Additional Fields Supported for BS2000

Dictionary Field Name F/L Mu DE Remarks
SYSTEM-CODE B2      
SAME A3   D  
DSORG A4   D  
FROM-ELEMENT A64   D  
FROM-ELEMENT-VERSION A24   D  
FROM-ELEMENT-TYPE A8   D  
FROM-ELEMENT-PASSWORD A8   D  
TO-ELEMENT A64   D  
TO-ELEMENT-VERSION A24   D  
TO-ELEMENT-TYPE A8   D  
TO-ELEMENT-PASSWORD A8   D  
TO-ELEMENT-USER-DATE A14   D  
TO-ELEMENT-USER-TIME A8   D  

Relevant Error Codes

Code Text z/OS z/VSE BS2000
530 Access denied by Security Facility X   X
549 Not a PDSE data set X    
659 Dataset is already cataloged X   X
670 View not supported on one of the operating systems X X  
673 Access error due to FILETABLE=STATIC   X  
674 VTOC error reading format-3 labels   X  
675 :1: not supported   X  
676 Not first volume of multi-volume file   X  
678 MEMBER already exists.     X
679 Input and output files are incompatible X X  
683

FAMS error, R15 = :1:, R0 = :2:

X    
685 FAMS subtask abended X    
699 GETVIS failed X X  
701 DSNAME missing X X X
772 Requested dataset not found X X X
798 Task was not started under TSOS.     X
799 Entire System Server internal error     X
858 Not authorized   X  
983 REMOTE-COPY not supported by COPY-FILE     X
991 Unknown product     X
998 Member not found X X  

Note:
Any possible return code from READ-FILE, WRITE-FILE, LIB-DIRECTORY, LIB-UPDATE, SYSTEM-INFO and NATPROC-LOGON may also be returned.

Field Descriptions

Note:
Specification of user ID and password are only required if they are different from the local user ID and password.

Field Name Format/Length Operating System
DSORG (A4) BS2000

For copy of LMS element to file: DSORG of target file. Possible values:

Value Explanation
CAT DSORG as defined within catalog entry of file.
SAM DSORG = SAM
ISAM DSORG = ISAM

The default is the default of the LMS.

Field Name Format/Length Operating System
ERROR-NODE (N5) z/OS, z/VSE , BS2000

If an error occurred during processing, this contains the node which returned the error code.

Field Name Format/Length Operating System
ERROR-VIEW (N3) z/OS, z/VSE , BS2000

If an error occurred during processing, this contains the view number (called internally by COPY-FILE) which returned the error code. If it is zero, then the error was not returned by a called view.

Field Name Format/Length Operating System
FROM-BLKSIZE (B2) z/VSE

Block size of file to be copied.

Field Name Format/Length Operating System
FROM-DSNAME (A54) z/OS, z/VSE , BS2000

Fully qualified input dataset name.

Field Name Format/Length Operating System
FROM-ELEMENT (A64) BS2000

Name of LMS element to be copied.

Field Name Format/Length Operating System
FROM-ELEMENT-PASSWORD (A8) BS2000

Password for protected input element.

Field Name Format/Length Operating System
FROM-ELEMENT-TYPE (A8) BS2000

Type of LMS element to be copied.

Field Name Format/Length Operating System
FROM-ELEMENT-VERSION (A24) BS2000

Version of LMS element to be copied.

Field Name Format/Length Operating System
FROM-LIBRARY (A8) z/VSE

Library name from which to copy.

Field Name Format/Length Operating System
FROM-LRECL (B2) z/VSE

Record length of file to be copied.

Field Name Format/Length Operating System
FROM-MEMBER (A8) z/OS, z/VSE

Name of the member to be copied.

Field Name Format/Length Operating System
FROM-MEMBER-TYPE (A8) z/VSE

Type of the member which is to be copied.

Field Name Format/Length Operating System
FROM-NODE (N5) z/OS, z/VSE

Entire System Server node ID from which to copy.

Field Name Format/Length Operating System
FROM-PASSWORD (A8) z/OS, BS2000

Password for input dataset.

Field Name Format/Length Operating System
FROM-PRODUCT (A1) z/OS, z/VSE , BS2000

Specify access method with FROM-LIBRARY:

Value Explanation
L  CA-Librarian
M  LMS (BS2000)
P  CA-Panvalet
Field Name Format/Length Operating System
FROM-RECFM (A2) z/VSE

Record format of file to be copied.

Field Name Format/Length Operating System
FROM-SUB-LIBRARY (A8) z/VSE

Sublibrary from which to copy.

Field Name Format/Length Operating System
FROM-TAPE-DDNAME (A8) z/OS, z/VSE

The DD name of the input tape as specified in the view FILE-ALLOCATE.

Field Name Format/Length Operating System
FROM-TAPE-FILE-SEQUENCE (B2) z/OS, z/VSE

The file number of the dataset to be read.

Field Name Format/Length Operating System
FROM-USERID (A8) z/OS, z/VSE

User ID in FROM-NODE.

Field Name Format/Length Operating System
FROM-USER-PASSWORD (A8) z/OS

User password in FROM-NODE.

Field Name Format/Length Operating System
FROM-VOLSER (A6) z/OS, z/VSE

Volume serial number of the input dataset.

Field Name Format/Length Operating System
FROM-VSAM-CATALOG (A7) z/VSE

Name of the VSAM catalog where the FROM-LIBRARY is kept.

Field Name Format/Length Operating System
REPLACE (A3) z/OS, z/VSE , BS2000

Possible options:

Option Explanation
NO  Add object to library. If an object with the same name already exists, issue error code.
REP  Replace object of the same name. If it does not exist, issue error code.
YES  Default. Add object to library. If an object with the same name already exists, replace it.
Field Name Format/Length Operating System
SAME (A3) BS2000

Specify YES for the output file to have the same security and save options as the input file.

Field Name Format/Length Operating System
TO-DSNAME (A54) z/OS, z/VSE , BS2000

Fully qualified output dataset name.

Field Name Format/Length Operating System
TO-ELEMENT (A64) BS2000

Name of target LMS element.

Field Name Format/Length Operating System
TO-ELEMENT-PASSWORD (A8) BS2000

Password for protected output element.

Field Name Format/Length Operating System
TO-ELEMENT-TYPE (A8) BS2000

Type of target LMS element.

Field Name Format/Length Operating System
TO-ELEMENT-USER-DATE (A14) BS2000

User date for output element. Format: YYYY-MM-DDaaaa, where aaaa can be any 4-character string.

Field Name Format/Length Operating System
TO-ELEMENT-USER-TIME (A8) BS2000

User time for output element. Format: HH:MM:SS.

Field Name Format/Length Operating System
TO-ELEMENT-VERSION (A24) BS2000

Version of LMS element to which is to be copied.

Field Name Format/Length Operating System
TO-LIBRARY (A8) z/VSE

Library name to which to copy.

Field Name Format/Length Operating System
TO-MEMBER (A8) z/OS, z/VSE

Name to be assigned to the member in the output dataset. By default, the name of the input member is taken.

Field Name Format/Length Operating System
TO-MEMBER-TYPE (A8) z/VSE

Type of the copied member in TO-LIBRARY.

Field Name Format/Length Operating System
TO-MSHP (A3) z/VSE

Indicate MSHP bypass required when copying members. Possible values:

Value Explanation
NO  No MSHP bypass required.
YES  MSHP bypass to be performed.
Field Name Format/Length Operating System
TO-NODE (N5) z/OS, z/VSE

Entire System Server node ID to which to copy.

Field Name Format/Length Operating System
TO-PASSWORD (A8) z/OS, BS2000

Password for output dataset.

Field Name Format/Length Operating System
TO-PRODUCT (A1) z/OS, z/VSE , BS2000

Specify access method for TO-LIBRARY:

Value Explanation
L  CA-Librarian
M  LMS (BS2000)
P  CA-Panvalet
Field Name Format/Length Operating System
TO-SUB-LIBRARY (A8) z/VSE

Sublibrary from which to copy.

Field Name Format/Length Operating System
TO-TAPE-DDNAME (A8) z/OS, z/VSE

The DD name of the output tape as specified in the view FILE-ALLOCATE.

Field Name Format/Length Operating System
TO-TAPE-FILE-SEQUENCE (B2) z/OS, z/VSE

The file number of the dataset to be written.

Field Name Format/Length Operating System
TO-USERID (A8) z/OS, z/VSE

User ID in TO-NODE.

Field Name Format/Length Operating System
TO-USER-PASSWORD (A8) z/OS

User password in TO-NODE.

Field Name Format/Length Operating System
TO-VOLSER (A6) z/OS, z/VSE

Volume serial number of the output dataset.

Field Name Format/Length Operating System
TO-VSAM-CATALOG (A7) z/VSE

Name of the VSAM catalog where the TO-LIBRARY is kept.