Data Conversion Cost
The following list provides advice on selecting the data types that convert most efficiently between Automation and COBOL.
If the source and destination data types are not strictly dictated, you can decrease the amount of CPU resource consumed by Transaction Integrator (TI) by appropriately selecting the data conversions that are performed (that is, selecting the source and destination data types wisely).
The most efficient way to pass data is to select an Automation type of
VT_BYTE
and a COBOL data type ofPIC X
untranslated. There is no conversion performed and the data is copied as is.The Automation type
VT_BSTR
(a UNICODE character string) converts efficiently to COBOLPIC X
. Be aware that aBSTR
is not the same as a C character data type; it is a Visual BasicString
.The most efficient numeric data type conversions are
VT_I2
(Visual BasicInteger
or Cshort
) to COBOLPIC S9(4) COMP
, andVT_I4
toPIC S9(8) COMP
.If the data type you want is a COBOL packed decimal, the best choice for data conversion performance is one of the Automation integer data types. If fractional parts are required (that is, a COBOL picture like
PIC S9(5)V99 COMP-3
), the best choice for the Automation type isVT_DECIMAL
(Decimal) orVT_CY
(Currency).When the COBOL data type is zoned decimal (that is, a COBOL picture similar to
PIC S9(7)V99 DISPLAY
), the same considerations as for packed decimal apply. It is slightly more work to convert Automation data types to and from zoned decimal than it is to perform the conversions to packed decimal. If the data is used in calculations on the mainframe system, it is more efficient to use packed decimal instead of zoned decimal.Converting floating point data types (Automation types
VT_R4
andVT_R8
) is, in most cases, the most expensive. ConvertingVT_R4
to a COBOLCOMP-1
, orVT_R8
to a COBOLCOMP-2
(a COBOL floating point number) data type is the most efficient conversion involving floating-point numbers.