User-Defined Edit Codes for Display Files

Edit codes 5 through 9 are user-defined edit codes. A user-defined edit code can do more editing than an OS/400 edit code. For example, you may need to edit numbers that include hyphens (such as telephone numbers) or more than one decimal point. You can use user-defined edit codes for these functions. These edit codes are named QEDIT5, QEDIT6, QEDIT7, QEDIT8, and QEDIT9, and can be referred to in DDS or a high-level language program by number (5, 6, 7, 8, or 9).

A user-defined edit code is an OS/400 object and must exist before display file creation. It is created using the Create Edit Description (CRTEDTD) command. When you create a display file in which a user-defined edit code is specified, editing information is extracted from the previously created edit description. Changing a user-defined edit code after display file creation does not affect the display file unless the display file is re-created.

The following table shows edit codes, unedited source data, and edited output. Zero suppression and decimal characters are determined by the system value QDECFMT. The date separator character is determined by the job attribute DATSEP. In this figure, QDECFMT is assumed to equal x (blank), and DATSEP is assumed to equal / (slash).

Table 9. Valid Edit Codes, Source Data, and Edited Output
Edit Codes Positive Number- Two Decimal Positions Positive Number- No Decimal Positions Negative Number- Three Decimal Positions1 Negative Number- No Decimal Positions1 Zero Balance- Two Decimal Positions1 Zero Balance- No Decimal Positions1
Unedited 1234567 1234567 xxxx.125- 125- xxxxxx xxxxxx
1 12,345.67 1,234,567 .125 125 .00 0
2 12,345.67 1,234,567 .125 125

3 12345.67 1234567 .125 125 .00 0
4 12345.67 1234567 .125 125

A 12,345.67 1,234,567 .125CR 125CR .00 0
B 12,345.67 1,234,567 .125CR 125CR

C 12345.67 1234567 .125CR 125CR .00 0
D 12345.67 1234567 .125CR 125CR

J 12,345.67 1,234,567 .125- 125- .00 0
K 12,345.67 1,234,567 .125- 125-

L 12345.67 1234567 .125- 125- .00 0
M 12345.67 1234567 .125- 125-

N 12,345.67 1,234,567 -.125 -125 .00 0
O 12,345.67 1,234,567 -.125 -125

P 12345.67 1234567 -.125 -125 .00 0
Q 12345.67 1234567 -.125 -125

W2 1234/567 1234/567 0/125 0/125 0/000 0/000
Y3 123/45/67 123/45/67 0/01/25 0/01/25 0/00/00 0/00/00
Z4 1234567 1234567 125 125

Notes:

  1. The x represents a blank.

  2. The W edit code suppresses the farthest left zero of a date field that is five digits long. It also suppresses the three farthest left zeros of a field that is six to eight digits long. For more information, see the second footnote in Table 8.

  3. The Y edit code suppresses the farthest left zero of a date field that is three to six digits long or eight digits long. It also suppresses the two farthest left zeros of a field that is seven positions long. For more information, see the third footnote in Table 8.

  4. The Z edit code removes the sign (plus or minus) and suppresses leading zeros.


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