3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Type Conversion : Numeric DISPLAY Items and Temporary Data Items
 
Share this page                  
Numeric DISPLAY Items and Temporary Data Items
Numeric DISPLAY Item's Picture
Temporary Item's Data Type - UNIX
Temporary Item's Data Type - VMS
With scaling
PIC S9(9)V9(9) USAGE COMP-3
COMP-2
With > 10 numeric digits
PIC S9(9)V9(9) USAGE COMP-3
COMP-2
No scaling and 10 numeric digits
4-byte COMP-5
4-byte COMP
COMP-3 items used to set or receive Ingres values also require some runtime conversion. This is not true if you are setting or receiving decimal data. This is true for Micro Focus COBOL when float values are received into COMP-3.
The preprocessor also generates code to use a temporary data item when Ingres data is to interact with a COBOL unscaled COMP data item whose picture string is exactly 10.
UNIX: Because a COBOL non-scaled numeric item whose picture contains 10 or fewer digits is regarded as compatible with the Ingres integer type, EQUEL/COBOL assigns such data to a temporary COBOL 4-byte COMP-5 data item to allow it to interact with Ingres integer data. Note that the range of the Ingres i4 type does not include all 10-digit numbers. If you have 10-digit numeric data outside the Ingres range, you should use a COMP-3 data item and choose the Ingres float type.
You can use only COMP data items or items that get assigned to temporary 4-byte COMP-5 data items (as described above) to set the values of Ingres integer objects, such as table field row numbers. You can, however, use any numeric data items to set and retrieve numeric values in Ingres database tables or forms.
The Ingres money type is represented as a COMP-3 data item. 
VMS: A COBOL non-scaled numeric item whose picture contains 10 or fewer digits is regarded as compatible with the Ingres integer type. However, the VAX standard data type for an unscaled 10-digit COMP item is a quadword (8 bytes). Therefore, EQUEL/COBOL assigns such data to a temporary COBOL 4-byte COMP data item to allow it to interact with Ingres integer data. Note that the range of the Ingres i4 type does not include all 10-digit numbers. If you have 10-digit numeric data outside the Ingres range you should use a COMP-1 or COMP-2 data item and choose the Ingres float type.
You can use only COMP data items or items that get assigned to temporary 4-byte COMP data items (as described above) to set the values of Ingres integer objects, such as table field row numbers. You can, however, use any numeric data items to set and retrieve numeric values in Ingres database tables or forms.
The Ingres money type is represented as COMP-2, an 8-byte floating-point value.