Printing records (PRINT, OUTFMT, and TOFILE(*PRINT) parameters)

Note:You can use the parameters described in this topic on the CPYF , CPYFRMDKT , CPYFRMQRYF , and CPYFRMTAP commands.

You can print a list of all records copied, all records excluded, or all records causing ERRLVL output errors. You do this by specifying PRINT special values on a copy command. You can specify one or more of these listings on a single copy command, using character or hexadecimal format.

You can also print an unformatted listing of records. See Creating an unformatted print listing for more information.

Printing a list of all records copied:

To print a list of all of the records that you copied, specify TOFILE(*PRINT) on the copy command. The records are printed using the IBM-supplied printer file QSYSPRT.

Printing a list of excluded records:

Specify *EXCLD on the PRINT parameter to print a listing of only the records that you excluded from the copy. When you specify PRINT(*EXCLD), the records print in the from-file format.

Printing a list of copied records:

Specify *COPIED on the PRINT parameter to print a listing of only the records that you copied. When you specify PRINT(*COPIED) and MBROPT(*UPDADD), the records copied and the records updated appear on the same listing. A message follows each updated record that states that it was an update.

Printing a list of records that cause errors:

Specify *ERROR on the PRINT parameter to print a listing of the records that caused ERRLVL output errors. (The ERRLVL parameter still controls the number of recoverable errors that can occur.) See Preventing errors when copying files for information on error recovery and the ERRLVL parameter. Only the number of records up to one (1) greater than the ERRLVL value that is specified are printed in the *ERROR listing. The listing is similar to the PRINT(*COPIED) and PRINT(*EXCLD) listings.

Selecting the format of the listing:

Use the OUTFMT parameter to specify whether your listing prints in character or hexadecimal format. The default value is *CHAR, and records print in character format. If you specify *HEX, records print in both character and hexadecimal format.

If you specify TOFILE(*PRINT), the OUTFMT parameter again specifies the format that is used to print the records.

When you specify PRINT(*EXCLD), the records print in the from-file format. All character data is in the CCSID specified in the from-file field. For TOFILE(*PRINT) and PRINT(*COPIED) listings, and when the to-file is a print file, character data is in the CCSID specified in the to-file fields.

Example:

In this example, all records that are not copied (or excluded records) are printed:

CPYF FROMFILE(DKTIN) TOFILE(LIB1/PF) +
     MBROPT(*ADD) INCCHAR(*RCD 80 *EQ X) +
     PRINT(*EXCLD)

The records print in character format.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]