UNSIGNED (Unsigned) keyword for physical and logical files

You can use this key field-level keyword to specify that numeric fields are sequenced as a string of unsigned binary data. The default values of character, date, time, timestamp, and hexadecimal fields are set to unsigned values.

This keyword has no parameters.

UNSIGNED is valid on key fields in physical or logical files regardless of the data type of the key field. The UNSIGNED keyword is not allowed with the SIGNED and ABSVAL keywords.

The UNSIGNED keyword will be the default in the following situations:
  • When you specify ALTSEQ at the file level for a zoned key field
  • When you specify ZONE or DIGIT for a zoned key field
  • For all character and hexadecimal fields
Note: You can specify UNSIGNED for floating point fields, but the results cannot be predicted.

The following figure 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 specify UNSIGNED, the records are sequenced in this order:

Record Numeric key field (zoned decimal) Hexadecimal representation
2 00 F0F0
5 20 F2F0
3 98- F9D8
4 97 F9F7
1 98 F9F8
6 99 F9F9

Example

The following example shows how to specify the UNSIGNED keyword for a physical file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A         R RECORDA
00020A           FLDA           7S 2
00030A           FLDB           5
00040A         K FLDA                      UNSIGNED
     A