EDTCDE (Edit Code) keyword in printer files

Use this keyword to edit output-capable numeric fields.

The format of the keyword is:

EDTCDE(edit-code [* | floating-currency-symbol])
Depending on which edit code you specify, you can change the appearance of the printed fields as follows:
  • Leading zeros are suppressed.
  • The field can be punctuated with commas and periods to show decimal position and to group digits by threes.
  • Negative values can be printed with a minus sign or CR to the right.
  • Zero values can be printed as zeros or blanks.
  • Asterisks can be printed to the left of significant digits to provide asterisk protection.
  • A currency symbol (corresponding to the system value QCURSYM) can be printed immediately to the left of the farthest- right significant digit (called a floating-currency symbol). For fixed-currency symbols, use the EDTWRD keyword.
  • The field can be further edited using a user-defined edit code.

EDTCDE covers most editing requirements. Use the EDTWRD keyword when EDTCDE is not sufficient.

EDTCDE is valid only for fields with S or a blank in position 35 (Data Type).

You cannot specify EDTCDE and EDTWRD for the same field. If you specify EDTCDE for a field previously defined in a database file, you need not specify EDTCDE for the field that you are defining. Instead, specify R in column 29 to refer to the previously defined field. The editing specified for that field is included in the printer file. If you specify length, data type, or decimal columns for a printer file field, editing specified for the referenced field is not included in the printer file and you must specify editing again in the printer file.

The DFT keyword cannot be specified with the EDTCDE keyword.

Option indicators are not valid for this keyword.

You can specify two kinds of edit codes: i5/OS™ edit codes and user-defined edit codes.

Example

The following example shows how to specify the EDTCDE keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00050A            PRICE          5  2   5  2EDTCDE(J *)
     A
Related concepts
EDTCDE keyword for display files