COMP Versus COMP-5

For integer fields in COBOL, COMP specifies the storage of half word, full word, or double word (2, 4, and 8 bytes, respectively). However, an additional limitation based on the number of decimal digits in the PICTURE clause applies.

For instance, even though PIC S9(4) COMP has a signed half-word storage, it limits the values to the range of -9999 though +9999 due to the four decimal places in the PICTURE clause.

To eliminate that limitation, use COMP-5. This usage, though the same as COMP, allows the whole range of values representable by a particular number of storage bytes. For example, PIC S9(4) COMP-5 has a half-word storage and allows the range of values of -32768 though +32767.

For more details, see the COBOL documentation.