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.
You cannot specify both the NBRRCDS and the TORCD or TOKEY parameters. The specified number of records is copied starting with the specified from-key value or from-record number.
CPYF FROMFILE(PERSONNEL/EMP1) + TOFILE(TESTLIB1/EMP1T) MBROPT(*REPLACE) + NBRRCDS(1000)You can also use the NBRRCDS parameter to examine a subset of records on a list:
CPYF FROMFILE(PERSONNEL/EMP1) TOFILE(*PRINT) + FROMRCD(250) NBRRCDS(10) OUTFMT(*HEX)
When you successfully copy an open query file, the file position is unpredictable. If you want to run a different program with the same files or run another CPYFRMQRYF, you must position the file or close the file and open it with the same OPNQRYF command. You can position the file with the Position Database File (POSDBF) command. In some cases, you can use a high-level language program statement.