Copy commands with DDM
This topic describes the DDM implications of these CL commands.
- Copy File (CPYF)
- Copy from Query File (CPYFRMQRYF)
- Copy from Tape (CPYFRMTAP)
- Copy Source File (CPYSRCF)
- Copy to Tape (CPYTOTAP)
These commands can be used to copy data or source between files on local and remote servers. You specify with these commands which file to copy from and which file to copy to. The following table shows you what database and device files can be copied between local and remote servers.
Table 1. Copy database and device files From file To file Local or remote database files Local or remote database files Local or remote database files Local device files Local device files Local or remote database files A DDM file is considered a device file that refers to a remote database file. Consider the following items when using these copy commands with DDM:
- DDM conversations are not reclaimed for a job when a copy command produces an error.
In releases before Version 3 Release 2, copy errors caused the Reclaim Resources (RCLRSC) command to be run, which also ran the Reclaim Distributed Data Management Conversations (RCLDDMCNV) command. The RCLRSC command is still run, but it no longer runs the RCLDDMCNV command when a copy error occurs. The DDM conversations will remain unless an explicit RCLDDMCNV is specified following the copy command with the error.
- If you specify a DDM file and a local file on the CPYF or CPYSRCF command, the server does not verify that the remote and local files are not the same file on the source server. If one DDM file is specified, a user can potentially copy to and from the same file.
- A DDM file can be specified on the FROMFILE and the TOFILE parameters for the CPYF and CPYSRCF commands.
For the Copy from Query File (CPYFRMQRYF), and Copy from Tape (CPYFRMTAP) commands, a DDM file name can be specified only on the TOFILE parameter; for the Copy to Tape (CPYTOTAP) command, a DDM file name can be specified only on the FROMFILE parameter.
- If the target server is not an iSeries™ server or a System/38™:
- When a file on the local iSeries server is copied to a remote file (or vice versa), FMTOPT(*NOCHK) is usually required.
- When a source file on the local iSeries server is copied to a remote file (or vice versa), FMTOPT(*CVTSRC) must be specified.
- If data is copied to a target System/36™ file that has alternative indexes built over it, MBROPT(*REPLACE) cannot be specified. In this case, the copy command attempts to clear the remote file, but it fails because of the alternative indexes.
- When an iSeries file that can contain deleted records is copied to one that cannot contain deleted records, specify COMPRESS(*YES), or an error message is sent and the job ends.
- If the remote file name on a DDM file specifies a member name, the member name specified for that file on the copy command must be the same as the member name on the remote file name on the DDM file. In addition, the Override Database File (OVRDBF) command cannot specify a member name that is different from the member name on the remote file name on the DDM file.
- If a DDM file does not specify a member name and if the OVRDBF command specifies a member name for the file, the copy command uses the member name specified on the OVRDBF command.
If the TOFILE parameter is a DDM file that refers to a file that does not exist, CPYF creates the file if CRTFILE(*YES) is specified. Listed here are special considerations for remote files created with the CPYF or CPYFRMQRYF commands:
- If the target system is an iSeries server or a System/38, the user profile for the target DDM job must be authorized to the CRTPF command on the target server.
- If the target server is a server other than an iSeries server, the file specified by the FROMFILE parameter cannot have any file or field CCSIDs other than *HEX or the CCSID of the source job.
- For the CPYF command, if the target server is a system other than an iSeries server, the FROMFILE parameter cannot be a source file.
- If the target server is a System/38, the TOMBR parameter must be the same as the remote file's name or *FIRST for the copy to be successful. The copy creates a member with the same name as the remote file's name.
- If the target server is other than a System/38 or iSeries server, for the copy to be successful, the TOMBR parameter must be *FIRST or specify the DDM file name. For DDM access to the remote file, the file appears to have a member with the same name as the DDM file.
- For an iSeries target server, the TOFILE parameter has all the attributes of the FROMFILE parameter.
- For target systems that are other than iSeries servers, those attributes on the CRTPF command that are ignored are also ignored when the copy command creates the file.
- If the target server is a System/38 and the FROMFILE parameter is a direct file that does not allow deleted records, an attempt is made to copy the records after the last record for the file at its maximum size. The system operator on the System/38 tells the server to either add the records or cancel the copy.
- The CPYF or CPYFRMQRYF command with CRTFILE(*YES) creates a file on the target server with a size description that is only as large as the target server allows.
- For all copies, if the number of records being copied exceeds the maximum allowed by the to-file, the copy function ends when the maximum is reached.
- For copy commands executed on Version 2 Release 3 or earlier systems that reference a Version 3 Release 1 remote file having a constraint relationship, the ERRLVL parameter will not work for constraint relationship violations. The copy ends regardless of the ERRLVL specified.
- The copy commands allow copying from and to DDM files that reference remote distributed files.
Parent topic:
DDM-related CL command considerations