The system provides editing support that makes fields more readable when they are printed. With the system editing support, you can do the following:
The system provides this editing support with edit codes and edit words. Edit codes are a defined set of editing patterns. You identify these by name, and the system edits a field according to the pattern defined by the named edit code. Edit words are edit patterns that you define to produce the results that you want. Edit codes include most commonly used editing requirements. You need to use the edit word support only for those editing needs not included by edit codes.
There are two methods of using edit codes and edit words. Which one you use depends on how you define the printer file and how it is used in an application program. If your application is using program-described data, your high-level language might allow you to identify edit codes or create your own edit words. If your application is using externally described data, the edit code (EDTCDE) DDS keyword allows you to identify an edit code; the edit word (EDTWRD) DDS keyword allows you to define your own editing pattern.
The system provides several edit codes:
The editing patterns defined by these codes are described in DDS Reference in the Programming topic.
User-defined edit codes
You can also define five edit codes to provide more editing function than is available with the i5/OS edit codes, and to handle common editing functions that would otherwise require the use of an edit word. These are called user-defined edit codes. For example, you might need to edit numbers that include hyphens (like some 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).
These edit codes are created by using the Create Edit Description (CRTEDTD) command. Edit descriptions are always placed in library QSYS. They cannot be moved or renamed; only one occurrence of each is allowed. Edit descriptions have an object type of *EDTD.
IBM® supplies a version of each of the QEDIT edit codes. You can use these edit descriptions as they are, or you can delete them and create your own. See DDS Reference in the Programming topic for more information about using these edit descriptions.
Before using any of the user-defined edit codes, you should check its contents on your system, since it might have been changed from the IBM-supplied version. The Display Edit Description (DSPEDTD) command can be used to display the contents of a user-defined edit code.
Changing a user-defined edit code description does not affect any application or printer file that has already been created using that edit description. If you want your application to use the changed edit description, you must either create the high-level language program again (if the edit code is used in the program) or create the file again (if the application is using an externally described file that contains EDTCDE keywords).