Difference between COMP and COMP-3

Comp refers to binary representation which occupies half word(16bits) or full word(32bits) and Comp-3 refers to packed decimal representation where one digit occupies half a byte ie, a nibble and the sign is stored as the rightmost half -a -byte. C or F represents the positive sign and D represents the negative sigh in hexadecimal format.

COMP

Comp is used for Binary Representation

it allows only S and 9 ...

s9(01) to s9(04) it takes 2 bytes memory

s9(05) to s9(09) it takes 4 bytes memory

s9(10) to s9(18) it takes 8 bytes memory

COMP-3

Comp-3 is used for Packed Decimal values

it allows S,9 ,V

mostly it is useful for Decimal Caluculation Values

it takes (n/2)+1 Bytes Memory