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 printer file creation. It is created using the Create Edit Description (CRTEDTD) command. When you create a printer 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 printer file creation does not affect the printer file unless the printer file is re-created.
The following table shows valid edit codes with examples of 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 6. Valid Edit Codes, Source Data, and Edited Output
Edit codes | Positive number with two decimal positions | Positive number with no decimal positions | Negative number with three decimal positions1 | Negative number with no decimal positions | Zero balance with two decimal positions1 | Zero balance with no decimal positions1 |
---|---|---|---|---|---|---|
Unedited | 1234567 | 1234567 | xxxx125- | xxxx125- | 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:
|
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.