COMP COMP-3-LMLPHP

COMP COMP-3-LMLPHP

Comp (Computational)

Comp (with no suffix) leaves the choice of the data type to the compiler writer.  The intent of this data type is to make it the most efficient format on any given machine, which is usually some binary format. Because of this, comp varies greatly between platforms, more than most other types.

Comp-1

Comp-1 is usually a single precision floating point value, stored in 4 bytes.  Many vendors follow the IEEE floating point standard, but IBM does not.

Comp-2

Comp-2 is usually a double precision floating point value, stored in 8 bytes.  Many vendors follow the IEEE standard, but IBM does not.

Comp-3

Although comp-3 is "vendor specific", the format of comp-3 fields is almost universal across platforms, even on ASCII machines.  Comp-3 stores data in a BCD -- binary coded decimal -- format with the sign after the least significant digit.  Comp-3 is so common that we have written a separate Tech Talk brief about it.  See COBOL Comp-3 Packed Fields.

05-11 20:35