Selecting the records to copy
You can use parameters on the copy commands to select only the specific records that you want to copy.
- Selecting records using a specified record format name (RCDFMT parameter)
You can use the RCDFMT parameter to select records of a certain record format to copy. Note that you can use this parameter on the CPYF command only.
- Selecting records by relative record numbers (FROMRCD and TORCD parameters)
You can use the FROMRCD and TORCD parameters to copy files with specifying their record numbers. Note that you can use these parameters on the CPYF command only.
- Selecting records by record keys (FROMKEY and TOKEY parameters)
You can specify record keys to copy only from a keyed database file. Note that you can use this parameter on the CPYF command only.
- Selecting a specified number of records (NBRRCDS parameter)
When you specify a FROMKEY or FROMRCD parameter, you can specify the number of records (NBRRCDS parameter) to be copied instead of the TOKEY or TORCD parameter.
- Selecting records based on character content (INCCHAR parameter)
You can select records on the basis of the content of characters that start in a specific position in the record or field.
- Selecting records based on field value (INCREL parameter)
You use the INCREL parameter to select records for copying by testing for the value of an entire field. Unlike the INCCHAR parameter, you can use the INCREL parameter only when you are copying from a database file, and you can test for different values in different fields on one copy command.
- Copying deleted records (COMPRESS parameter)
You might want to copy deleted records to preserve the relative record numbers of records that are copied from the from-file. You can copy both deleted and undeleted records from one physical file member to another by specifying the COMPRESS(*NO) parameter on a copy command.
Parent topic:
Copying files
Related concepts
Record sequence and copying
Copying physical or logical files
Related information
Database Programming
Control language (CL)