Not coding the S for sign in the picture will cause values to be stored with "F" as the sign. An positive integer value which mathematically equal to +1.
If you code an even number of digits, the compiler will always make it 1 byte larger internally.
Thus,
S9(6) COMP-3 will take 4 bytes of storage
S9(7) COMP-3 will take 4 bytes of storage This is the preferred way as it is clear to anyone what was intended.
Joined: 06 Jun 2008 Posts: 936 Location: Atlanta, GA
No:
Hex 0004D2 is the BINARY (or COBOL COMP) value of +1234.
Hex 01234C is the PACKED-DECIMAL (or COBOL COMP-3) value of +1234.
Hex F1F2F3F4 is the unsigned COBOL DISPLAY value of 1234.
Hex F1F2F3C4 is the signed COBOL DISPLAY value of +1234.