Copy File command with distributed files with DB2® Multisystem
When the Copy File (CPYF) ommand is issued, the system tries to run the CPYF command as quickly as possible.
The command parameters specified, the file attributes involved in the copy, and the size and number of records to be copied all affect how fast the command is run.
When copying data to distributed files, the performance of the copy command can be improved by using only the following parameters on the CPYF command: FROMFILE, TOFILE, FROMMBR, TOMBR, MBROPT, and FMTOPT(*NONE) or FMTOPT(*NOCHK). Also, the from-file (FROMFILE) and the to-file (TOFILE) parameters should not specify files that contain any null-capable fields. Generally, the simpler the syntax of the copy command is, the greater the chance that the fastest copy operation is obtained. When the fastest copy method is being used while copying to a distributed file, message CPC9203 is issued, stating the number of records copied to each node. Normally, if this message was not issued, the fastest copy was not performed. When copying to a distributed file, you should consider the following differences between when the fastest copy is and is not used:
For the fastest copy, records are buffered for each node. As the buffers become full, they are sent to a particular node. If an error occurs after any records are placed in any of the node buffers, the system tries to send all of the records currently in the node buffers to their correct node. If an error occurs while the system is sending records to a particular node, processing continues to the next node until the system has tried to send all the node buffers.
In other words, records that follow a particular record that is in error can be written to the distributed file. This action occurs because of the simultaneous blocking done at the multiple nodes. If you do not want the records that follow a record that is in error to be written to the distributed file, you can force the fastest copy not to be used by specifying on the CPYF command either ERRLVL(*NOMAX) or ERRLVL with a value greater than or equal to 1.
When the fastest copy is not used, record blocking is attempted unless the to-file open is or is forced to become a SEQONLY(*NO) open.
When the fastest copy is used, a message is issued stating that the opening of the member was changed to SEQONLY(*NO); however, the distributed to-file is opened a second time to allow for the blocking of records. You should ignore the message about the change to SEQONLY(*NO).
When the fastest copy is used, multiple messages are issued stating the number of records copied to each node. A message is then sent stating the total number of records copied.
When the fastest copy is not used, only the total number of records copied message is sent. No messages are sent listing the number of records copied to each node.
Consider the following restrictions when copying to or from distributed files:
- The FROMRCD parameter can be specified only with a value of *START or 1 when copying from a distributed file. The TORCD parameter cannot be specified with a value other than the default value *END when copying from a distributed file.
- The MBROPT(*UPDADD) parameter is not allowed when copying to a distributed file.
- The COMPRESS(*NO) parameter is not allowed when the to-file is a distributed file and the from-file is a database delete-capable file.
- For copy print listings, the RCDNBR value given is the position of the record in the file on a particular node when the record is a distributed file record. The same record number appears multiple times on the listing, with each one being a record from a different node.
Parent topic:
CL commands: Affecting all the pieces of a distributed file with DB2 Multisystem