Use this key field level keyword to direct the operating system to ignore the sign of the field when it sequences the values associated with this numeric field. 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 |
If you do not specify any sequencing keywords or the ALTSEQ keyword, the default sequencing for the key field is the SIGNED attribute. In this case, 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 you specify the ABSVAL keyword, the absolute value of the negative field is used, and the resulting sequence is:
Record | Numeric key field (zoned decimal) | Hexadecimal representation |
---|---|---|
2 | 00 | F0D0 |
5 | 20 | F2F0 |
4 | 97 | F9F7 |
1 | 98 | F9F8 |
3 | 98- | F9D8 |
6 | 99 | F9F9 |
The ABSVAL keyword is not valid for a character, date, time, timestamp, and hexadecimal data type field. You cannot use this keyword with the DIGIT, SIGNED, UNSIGNED, or ZONE keywords.
ABSVAL (a key field-level keyword) causes ALTSEQ (a file-level keyword) to be ignored. If you specify ABSVAL for a key field, NOALTSEQ is in effect for that key field, even if ALTSEQ was specified at the file level. This occurs, even if the NOALTSEQ keyword is specified.
The following example shows how to specify the ABSVAL keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A ORDAMT 5 0 00020A K ORDAMT ABSVAL A