Previous Topic: Testing RecommendationsNext Topic: DBMS Considerations with Decimal Precision


COBOL Application Considerations

This section addresses retargeting COBOL generated applications to either C, C#, or Java. COBOL has the capability of storing and manipulating numbers with precision. The native C, C#, or Java data types have limitations in either the number of digits or their precision. For example, most numbers with decimal digits will be generated as a double, which has a limit of 15 digits of precision and can lose precision when used in some mathematical operations.

CA Gen has the capability of generating an alternative data type that can achieve 18 digits of precision. In C, CA Gen uses a character array and a special software library. In C#, CA Gen uses the decimal type from the system package. In Java, CA Gen uses the BigDecimal class from the java.math package.

Using these alternative data types consumes more CPU resources, as it uses a software library to perform the mathematical operations, whereas, the double data type uses the hardware instructions to perform the same mathematical operations.

CA Gen does not generate these alternative data types automatically. Rather, you should examine your data model and determine which attributes should be generated in this alternative form and set the appropriate option.

After an attribute has been identified, its properties dialog should be displayed by either double-clicking on the attribute or selecting the attribute and then choosing Properties from the Detail menu. To instruct CA Gen to generate the alternative data type, select the Implement in C, C#, and Java with decimal precision check box.