Moving data between systems using copy file commands
Another way to move data from one i5/OS® operating system to another is to copy the data using the copy file commands with DDM.
You can use the Copy File (CPYF), Copy Source File (CPYSRCF), and Copy From Query File (CPYFRMQRYF) commands to copy data between files on source and application servers (ASs). You can copy local relational database or device files from (or to) remote database files, and remote files can also be copied to remote files.
For example, if a dealership closes, the distributed relational database administrator can copy the client and inventory tables from the remote system to the local regional system. The administrator needs a properly authorized user profile on the application server (AS) to access and copy the tables and must create a DDM file on the application requester (AR) for each table or file that is copied. The following example shows the command that the database administrator uses to copy a table called INVENT in a collection called SPIFFY from a system with a remote location name of KC105 to a regional center system called KC000. A DDM file called INCOPY in a library called TEST on the application requester (AR) KC000 is used for the file access. These commands are run on the KC000 system:
CRTDDMF FILE(TEST/INCOPY) RMTFILE(SPIFFY/INVENT) RMTLOCNAME(KC105) CPYF FROMFILE(TEST/INCOPY) TOFILE(TEST/INVENTDDM) MBROPT(*ADD)In this example, the administrator runs the commands on the KC000 system. If the administrator is not on the KC000 system, then pass-through must be used to run these commands on the KC000 system. The Submit Remote Command (SBMRMTCMD) command cannot be used to run the preceding commands because the i5/OS operating system cannot be an application requester (AR) and an application server (AS) for the same job.
Consider the following items when using this command with DDM:
- A DDM file can be specified on the FROMFILE and the TOFILE parameters for the Copy File (CPYF) command and Copy Source File (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.
- When a delete-capable file is copied to a non-delete capable file, 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 File (CPYF) command must be the same as the member name on the remote file name on the DDM file. In addition, the Override with 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 Override with Database File (OVRDBF) command specifies a member name for the file, the Copy File (CPYF) 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. Keep the following special considerations for remote files created with the Copy File (CPYF) command in mind:
- The user profile for the target DDM job must be authorized to the Create Physical File (CRTPF) command on the application server (AS).
- For an i5/OS target, the TOFILE parameter has all the attributes of the FROMFILE parameter except those described in the Database file management topic collection.
- When using TCP/IP, the second element of the RMTLOCNAME parameter of the Create Distributed Data Management File (CRTDDMF) command must be *IP.
Parent topic:
Moving data from one system to another
Related concepts
Database file management
Distributed data management
Related reference
Copy File (CPYF) command
Copy Source File (CPYSRCF) command
Copy From Query File (CPYFRMQRYF) command
Copy from Tape (CPYFRMTAP) command
Copy To Tape (CPYTOTAP) command
Create Physical File (CRTPF) command
Create Distributed Data Management File (CRTDDMF) command
Override with Database File (OVRDBF) command
Submit Remote Command (SBMRMTCMD) command