Chapter 10. Editing Numeric Fields

Editing provides a means of:

This chapter applies only to non-float numeric fields. To output float fields in the external display representation, specify blank in position 52 of the output specification. To obtain the external display representation of a float value in calculations, use the %EDITFLT built-in function.

A field can be edited by edit codes, or edit words. You can print fields in edited format using output specifications or you can obtain the edited value of the field in calulation specifications using the built-in functions %EDITC (edit code) and %EDITW (edit word).

When you print fields that are not edited, the fields are printed as follows:

The following examples show why you may want to edit numeric output fields.

Type of Field Field in the Computer Printing of Unedited Field Printing of Edited Field
Alphanumeric
 
Numeric
(positive)
 
Numeric
(negative)
JOHN T SMITH
 
0047652
 
 
004765K
JOHN T SMITH
 
0047652
 
 
004765K
JOHN T SMITH
 
  47652
 
 
  47652-

The unedited alphanumeric field and the unedited positive numeric field are easy to read when printed, but the unedited negative numeric field is confusing because it contains a K, which is not numeric. The K is a combination of the digit 2 and the negative sign for the field. They are combined so that one of the positions of the field does not have to be set aside for the sign. The combination is convenient for storing the field in the computer, but it makes the output hard to read. Therefore, to improve the readability of the printed output, numeric fields should be edited before they are printed.



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