Copy database source files to database source files

When you copy database source files to database source files, you use SRCOPT(*SEQNBR) and the SRCSEQ parameter to assign sequence numbers to the copied records.

You can copy between database source files by using the CPYSRCF or CPYF command. The CPYSRCF command might be easier to use because the parameter defaults are better suited for copying database source files.

If you specify SRCOPT(*SEQNBR) to update the sequence numbers, the server considers the SRCSEQ parameter. The SRCSEQ parameter specifies the starting value that is assigned to the first record that is copied and the increment value. The defaults are 1.00 and 1.00. You can specify a whole number of no more than 4 digits or a fraction of no more than 2 digits for the starting value and the increment value. You must use a decimal point for fractions.

For example, if you specify SRCSEQ(100.50), then the records copied will have sequence numbers 100.00, 100.50, 101.00, 101.50, and so on.

Suppose that you have a file that contains more than 9999 records. Use a fractional increment value so that each record has a unique sequence number. If you specify a starting value of .01 and an increment value of .01, the maximum number of records copied with unique sequence numbers is 999 999. When the maximum sequence number is exceeded (9999.99), all remaining records on that copy are initialized to 9999.99. The server does not wrap back to 1.00.

If the database source file that you are copying to has only an arrival sequence access path, the records are always physically placed at the end of the file. (Because the file does not have a keyed sequence access path, you cannot insert records into the middle of the file keyed access path.)