Sign in

docs DDS Physical

UNSIGNED (Unsigned) keyword for physical and logical files

UNSIGNED (Unsigned) keyword for physical and logical files

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:

RecordNumeric key field (zoned decimal)Hexadecimal representation
198F9F8
200F0F0
398-F9D8
497F9F7
520F2F0
699F9F9

If you specify UNSIGNED, the records are sequenced in this order:

RecordNumeric key field (zoned decimal)Hexadecimal representation
200F0F0
520F2F0
398-F9D8
497F9F7
198F9F8
699F9F9

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