Appendix A. Field Buffer Calculation

Table of Contents

A.1. Tmax Field Calculation Method
A.2. Tuxedo FML16 Calculation Method (Tuxedo 6.4)

This appendix describes how to calculate a field buffer when migrating a Tuxedo environment that uses FML to Tmax.

A.1. Tmax Field Calculation Method

The following describes how to calculate the size of a buffer according to field type.

Field TypeSize
StringHeader 4bytes + Date len + Null 1bytes + Padding
CarrayHeader 4bytes +Specified Length + 4(Specified Length)bytes + Padding
CharHeader 4bytes, Data 4bytes
ShortHeader 4bytes, Data 4bytes
LongHeader 4bytes, Data 4bytes
FloatHeader 4bytes, Data 4bytes
DoubleHeader 4bytes, Data 8bytes + Padding (4bytes)

The following is an example of how to calculate the size of a buffer.

Buffer size = FDL buffer header + (Field header(4) + Data length + Padding) * Input counts 

Note

Data must be 8-byte-aligned for padding.

Example

The following is an example of how to calculate Tax FD values.

F1 integer 
F2 long 
F3 float 
F4 double 
F5 STRING length 10 
F6 STRING length 19 
F7 CARRAY length 22 

Buffer size is calculated according to the field type as shown below.

F1 integer 
F2 long 
F3 float 
F4 double 
F5 STRING Length 10 
F6 STRING Length 19 
F7 CARRAY Length 22 

F1 integer : 8 (Header field(4) + 4)
F2 long : 8 (Header field(4) + 4)
F3 float : 8 (Header field(4) + 4)
F4 double : 16 (Header field(4) + 8) + 4(padding)
F5 STRING length 10 : 16  (Header field(4) + 10 + 1(null)) + 1
F6 STRING length 19 : 24  (Header field(4) + 19 + 1(null)) 
F7 CARRAY length 22 :  32  (Header field(4) + 22 + 4(int for specifying the length)) + 2
Total : 112

According to the buffer usage calculation method, a buffer of 179200 bytes is required to send 200 records.

fdl buffer header(8) + (length of a record * counts) 
8 + (112 * 200)  = 179200 byte

A.2. Tuxedo FML16 Calculation Method (Tuxedo 6.4)

The following describes how to calculate buffer size according to field type.

Field TypeSize
StringHeader 4bytes, Null 1byte
CarrayHeader 4bytes
CharHeader 2bytes, Data 2bytes
ShortHeader 2bytes, Data 2bytes
LongHeader 2bytes, Data 4bytes
FloatHeader 2bytes, Data 4bytes
DoubleHeader 2bytes, Data 8bytes

Note

FML 16 has 2 bytes for a header field and a data field, and FML32 and Tax use 4 bytes for the fields. The FML32 calculation method has a slight difference in size between the Tax FD and the actual data size, while the FML 16 calculation method shows a notable difference in size. A field buffer size should be correctly calculated when migrating Tuxedo to Tmax.