INTEGER Type

12-1
The INTEGER type is used to contain any positive or negative whole numbers in the range -2,147,483,648 to 2,147,483,647 (that is, a signed 32 bit number).

External Form -- Input

Valid input consists of a string of up to 15 digits optionally preceded by a plus sign (+) or a minus sign (-), which provides the sign (positive or negative) of the value. The sign is positive, if omitted. All other characters must be valid digits (that is, 0 to 9). Alternatively, if the map definition included named values for this component, the symbolic name of the named value can be supplied as external form input.

External Form -- Output

Output consists of a string of one or more local characters. If the integer value is negative, the first character is a minus sign (-), otherwise the sign is omitted. All other characters are numeric characters. Leading zeroes are stripped.

Local Form and Behavior

Internally, Mapping Services can store integers in one of the following formats:
Binary
Can be up to 4 bytes in length. If the length is not fixed, the value is kept in the smallest number of bytes possible. If the length is fixed, the value is right aligned and sign extended to the left.
Packed
Can be up to 8 bytes in length. The integer value is converted to the packed decimal equivalent. If the length is not fixed, the value is kept in the smallest number of bytes possible. If the length is fixed, the value is right aligned and zero padded to the left.
Zoned
Can be up to 15 bytes in length. The integer value is converted to the packed decimal equivalent. If the length is not fixed, the value is kept in the smallest number of bytes possible. If the length is fixed, the value is right aligned and zero padded to the left.
For any format, if a value exceeds that which can be stored without loss of significance a type check results. If a named value is input, the map definition is used to determine the actual integer value.

Named Values

It is possible to specify a range of names that correspond to particular integer values in an INTEGER type definition. For example:
x INTEGER   {red (1),              green (5)              blue (7)}
These names can then be used as external input to represent the corresponding value. On retrieval the integer value is returned.

Constraints

It is possible to constrain the allowed set of integers for an integer type. This is done by specifying a list of integer ranges and/or single values. For example:
( 1..10 | 20..30 | 50 | 100 )
In the above example the integer values are restricted to numbers 50, 100 and the range 1 to 30. If anything else is entered, a type check error results.