COMP-1 refers to short (single-precision) floating-point format, and COMP-2 refers to long (double-precision) floating-point format, which occupy 4 and 8 bytes of storage, respectively. The leftmost bit contains the sign; the next seven bits contain the exponent; the remaining 3 or 7 bytes contain the mantissa.
On OS/400, COMP-1 and COMP-2 data items are represented in IEEE format.
A PICTURE clause is not allowed in the data description of floating-point data items, but you can provide an initial value using a floating-point literal in the VALUE clause:
05 COMPUTE-RESULT USAGE COMP-1 VALUE 06.23E-24.
The characteristics of conversions between floating-point format and other number formats are discussed in the section, Data Format Conversions.
Floating-point format is well-suited for containing arithmetic operands and results, and for maintaining the highest level of accuracy in arithmetic.
For complete information on the data descriptions for numeric data, see WebSphere Development Studio: ILE COBOL Reference.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.