You can control how the computer stores numeric data items by coding the USAGE clause in your data description entries.
You might want to control the format for any of several reasons such as these:
The numeric data you use in your program will have one of the following formats available with COBOL:
COMP and COMP-4 are synonymous with BINARY, and COMP-3 is synonymous with PACKED-DECIMAL.
The compiler converts displayable numbers to the internal representation of their numeric values before using them in arithmetic operations. Therefore it is often more efficient if you define data items as BINARY or PACKED-DECIMAL than as DISPLAY or NATIONAL. For example:
05 Initial-count Pic S9(4) Usage Binary Value 1000.
Regardless of which USAGE clause you use to control the internal representation of a value, you use the same PICTURE clause conventions and decimal value in the VALUE clause (except for internal floating-point data, for which you cannot use a PICTURE clause).
Examples: numeric data and internal representation
related concepts
Formats for numeric data
Data format conversions
Intermediate results and arithmetic precision
related references
Conversions and precision
Sign representation of zoned and packed-decimal data