You should be aware of the following differences between the representation of numeric DISPLAY format data items, with sign INCLUDED, under the RM/COBOL system and this COBOL system:
- This COBOL system does not encode a sign on the data if the data is positive, whereas the RM/COBOL system increments the value of the most significant half-byte by one to denote a positive value.
- This COBOL system increments the value of the most significant half-byte by four to denote a negative value. The RM/COBOL system increments the value of the byte by twenty-five (that is, hexadecimal 19).
When the DIALECT"RM" directive is set, a DISPLAY format data item with no sign clause associated is treated by this system as though you had specified the SIGN TRAILING IS SEPARATE clause. However, when the RM"ANSI" directive is set, the same data item is treated as though you had specified the SIGN TRAILING IS INCLUDED clause. This is the default state for such data items in this COBOL system.
Consider the following examples:
Value
|
Picture Clause
|
RM Representation (Hexadecimal)
|
Leading
|
Trailing
|
123
|
PIC 9(3) DISPLAY
|
31 32 33
|
31 32 33
|
123
|
PIC S9(3) DISPLAY
|
41 32 33
|
31 32 43
|
-123
|
PIC S9(3) DISPLAY
|
4A 32 33
|
31 32 4C
|
These examples are represented as follows:
Value
|
Picture Clause
|
This COBOL's Representation (Hexadecimal)
|
Leading
|
Trailing
|
123
|
PIC 9(3) DISPLAY
|
31 32 33
|
31 32 33
|
123
|
PIC S9(3) DISPLAY
|
31 32 33
|
31 32 33
|
-123
|
PIC S9(3) DISPLAY
|
71 32 33
|
31 32 73
|