VisualAge Generator to Enterprise Generation Language Migration Guide

Numeric variable fields

VisualAge Generator: A numeric field on a map has one length. The length should be long enough to allow for all the digits, the decimal point, sign, currency symbol, and numeric separator. However, if the field is not long enough at runtime, VisualAge Generator omits the currency symbol and numeric separator. VisualAge Generator also omits the sign if it is positive. If necessary to fit into the space allowed, VisualAge Generator drops the high order digits.

EGL: Variable fields on a form specify both a type definition, which includes the number of digits and decimals, and a fieldLen that specifies the space that the data occupies on the form. If the fieldLen is not big enough to contain all the digits and formatting characters at runtime, EGL issues a runtime message.

Associated part needed for migration: Not applicable.

Figure 23. Numeric variable fields

Migrating with the associated part Migrating without the associated part
When migrating a numeric field on the map, the migration tool sets the length and fieldLen as follows:
  • The migration tool always sets the fieldLen to the same length as specified for the variable field in VisualAge Generator.
  • The migration tool sets the length and decimals in the type definition as follows:
    • If the variable field does not specify decimals, the migration tool sets the length in the type definition to the fieldLen.
    • If the variable field specifies decimals, the migration tool sets the length in the type definition to fieldLen minus 1 to allow for entry of the decimal point. This technique avoids any overflow problems that might occur at run time.
The migration tool does the same thing as mentioned in the Migrating with the associated part column.

Potential Problem: If the field length on the form is not large enough at run time to contain all the digits, decimal point, sign, currency symbol, and numeric separator characters, EGL issues a run time error message.

Solution: Change the form definition so that the fieldLen is large enough to contain the largest possible number that will occur at run time and all the formatting characters that you specify.

The same problem listed under the Migrating with the associated part column can occur. You can use the same solution.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]