Use this key field-level keyword to specify that when sequencing the values associated with this numeric key field, the OS/400 program is to consider the signs of the values (negative versus positive values).
This keyword has no parameters.
The following example shows six records with a zoned decimal key
field:
Record | Numeric Key Field (Zoned Decimal) | Hexadecimal Representation |
---|---|---|
1 | 98 | F9F8 |
2 | 00 | F0F0 |
3 | 98- | F9D8 |
4 | 97 | F9F7 |
5 | 20 | F2F0 |
6 | 99 | F9F9 |
By default (with no sequencing keywords specified and without the ALTSEQ
keyword), the key field has the SIGNED attribute. The records are
sequenced in the following order:
Record | Numeric Key Field (Zoned Decimal) | Hexadecimal Representation |
---|---|---|
3 | 98- | F9D8 |
2 | 00 | F0F0 |
5 | 20 | F2F0 |
4 | 97 | F9F7 |
1 | 98 | F9F8 |
6 | 99 | F9F9 |
If both SIGNED and DESCEND are specified, the records are sequenced in this
order:
Record | Numeric Key Field (Zoned Decimal) | Hexadecimal Representation |
---|---|---|
6 | 99 | F9F9 |
1 | 98 | F9F8 |
4 | 97 | F9F7 |
5 | 20 | F2F0 |
2 | 00 | F0F0 |
3 | 98- | F9D8 |
This keyword is not valid for a character, date, time, timestamp, or hexadecimal data type field. You cannot use it with the ABSVAL, DIGIT, UNSIGNED, or ZONE keywords.
SIGNED (a key field-level keyword) causes ALTSEQ (a file-level keyword) to be ignored. If you specify SIGNED for a key field, NOALTSEQ is automatically in effect for that key field even if ALTSEQ is specified at the file level. This occurs whether or not NOALTSEQ is specified.
Example:
The following example shows how to specify the SIGNED keyword for a physical file.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RECORD 00020A FLDA 7S 2 00030A FLDB 00040A K FLDA SIGNED A
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.