Note: For all these edit codes, decimal points are always shown, and leading zeros are always suppressed.

Query uses the J edit code as the default edit code whenever an error occurs during numeric field editing or whenever there are no other editing values to use. If an error occurs, an error message is shown along with the edited result produced using the J code.

For a field that does not have an edit code specified in its definition, edit code J is shown as the default the first time you see this display for that field.

The other edit codes and edit descriptions are:

vEdit code W suppresses the three leftmost zeros of a date field that is six to eight digits long, and it suppresses the leftmost zero of a date field that is five digits long. It also inserts slashes (/) between the year, month, and day. The positions of the slashes depend on the number of digits in the field: nn/nnn, nnnn/nn, nnnn/nnn, and nnnn/nn/nn.

vEdit code X shows the values in their unedited form. For example, a value of −12 is shown as 1K. You can think of the unedited form as the character presentation of the hexadecimal string that makes up the zoned decimal representation for the numeric value. Table 4 shows the unedited presentation form and internal representation of numbers in zoned, packed, and binary format.

Table 4. Edit Code X Examples

 

 

 

 

 

 

 

Internal

 

 

 

Unedited

Representation (How

Format

Length/ Dec. Places

Actual Value

Presentation

Stored)

 

 

 

 

 

Zoned

7

549134

0549134

X’F0F5F4F9F1F3F4’

 

 

 

 

 

Packed

7

549134

0549134

X’0549134F’

 

 

 

 

 

Binary

7

549134

0549134

X’008610E’

 

 

 

 

 

Zoned

5/2

-319.34

3194N

X’F3F1F9F4D5’

 

 

 

 

 

Packed

5/2

-319.34

3194N

X’31945D’

 

 

 

 

 

Binary

5/2

-319.34

3194N

X’000F8337’

vEdit code Y suppresses the farthest left zero of a date field that is three to six digits long or eight digits long, and it suppresses the two farthest left zeros of a date field that is seven digits long. It also inserts slashes (/) between the month, day, and year. The positions of the slashes depend on the number of digits in the field: nn/n, nn/nn, nn/nn/n, nn/nn/nn, and nnn/nn/nn, and nn/nn/nnnn.

vEdit code Z removes any plus or minus sign from a numeric field and suppresses leading zeros.

vEdit descriptions 5 through 9 are user-defined edit codes. They can be defined to use other characters or combinations of characters to edit a numeric field.

The negative sign is on the left of the value for edit codes N through Q, and on the right of the value for other edit codes and edit descriptions.

You must either specify an edit code here or press F12 to return to the Define Numeric Field Editing display. (You can then specify, for example, option 4 in Edit option and then define your own edit words on the Specify Edit Word display.)

vThe only currency symbol that can be used with any of these edit codes is the one defined in the system-supplied system value QCURSYM.

vIf date/time edit code Y is specified for a field, the field must be three to eight digits long.

vIf the definition of an edit code is changed (done outside of Query), the changes are reflected in all query reports that use that edit code.

130Query for iSeries Use V5R2

Page 142
Image 142
IBM SC41-5210-04 manual Internal