Handling of Computation Items

Numeric values in COBOL files are commonly stored in the display or character format, that is, as base-10 numbers, with each digit represented by the corresponding character. For example, a field defined as PIC 999 that contains the value 123 is stored in three bytes, each byte containing one digit of the value.

When performing computations with numbers, machines can perform the computations significantly faster on binary (base-2) numbers than base-10 numbers. Therefore, if a number is stored in a COBOL data file in binary format, it can be input directly from the file and used in computations. You can use various flavors of COMP (such as COMP-3, COMP-4, and so on) to change the storage format from text to binary form.