How is sign stored in a COMP field?
-
In the least significant bit. Bit is ON if -ve, OFF if +ve.
-
In the most significant bit. Bit is ON if -ve, OFF if +ve.
-
In the least significant bit. Bit is ON if +ve, OFF if -ve.
-
In the most significant bit. Bit is ON if +ve, OFF if -ve.
In COMP (binary/computational) fields, the sign is stored in the most significant bit (leftmost bit). When the number is negative, this bit is ON (1), and when positive, the bit is OFF (0). This follows standard binary signed number representation using two's complement.
In COMP (binary/two's-complement) fields, the sign is encoded in the most significant bit: if that bit is set (ON), the value is negative; if it's clear (OFF), the value is positive or zero. This is standard two's-complement representation used by binary numeric fields on mainframe systems, distinct from sign-trailing/leading conventions used in packed-decimal fields.