Unsigned Format

The unsigned integer format is like the integer format except that the range of values does not include negative numbers. You should use the unsigned format only when non-negative integer data is expected.

You define an unsigned field by specifying U in the Data-Type entry of the appropriate specification. You can also define an unsigned field using the LIKE keyword on the definition specification where the parameter is an unsigned field.

The length of an unsigned field is defined in terms of number of digits; it can be 3, 5, 10, or 20 digits long. A 3-digit field takes up 1 byte of storage; a 5-digit field takes up 2 bytes of storage; a 10-digit field takes up 4 bytes; a 20-digit field takes up 8 bytes. The range of values allowed for an unsigned field depends on its length.

Field length
Range of Allowed Values
3-digit unsigned
0 to 255
5-digit unsigned
0 to 65535
10-digit unsigned
0 to 4294967295
20-digit unsigned
0 to 18446744073709551615

For other considerations regarding the use of unsigned fields, including information on alignment, see Integer Format.



[ Top of Page | Previous Page | Next Page | Contents | Index ]