3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Type Conversion : Runtime Numeric Type Conversion
 
Share this page                  
Runtime Numeric Type Conversion
The Ingres runtime system provides automatic data type conversion between numeric-type values in the database and the forms system and numeric COBOL data items. It follows the standard COBOL type conversion rules. For example, if you assign the value in a scaled COMP-3 data item for UNIX or a COMP-1 data item for VMS to an integer-valued field in a form, the digits after the decimal point of the data item's value are truncated. Runtime errors are generated for overflow on conversion.
The preprocessor generates COBOL MOVE statements to convert various COBOL data types. These can again be converted at runtime based on the final value being set or retrieved. Note that the standard COBOL data conversion rules hold for all these generated MOVE statements, with a potential loss of precision.
Floats are coerced to decimal types by Ingres at runtime. The preprocessor uses temporary data items when moving values between numeric DISPLAY data items and Ingres objects. Depending on the PICTURE clause of the DISPLAY item, these temporary data items are either:
COMP-3 or 4-byte COMP-5 for UNIX
or
COMP-2 or 4-byte COMP for VMS