Field Buffer Calculation
This appendix explains how to calculate a field buffer when migrating a Tuxedo environment that uses FML to Tmax.
1. Tmax Field Calculation Method
The following table shows how to calculate the buffer size based on the field type.
Filed Type | Size |
---|---|
String |
Header 4 bytes + Date length + Null 1 byte + Padding |
Carray |
Header 4 bytes + Specified Length + 4 (Specified Length) bytes + Padding |
Char |
Header 4 bytes, Data 4 bytes |
Short |
Header 4 bytes, Data 4 bytes |
Long |
Header 4 bytes, Data 4 bytes |
Float |
Header 4 bytes, Data 4 bytes |
Double |
Header 4 bytes, Data 8 bytes + Padding (4 bytes) |
The following shows how to calculate the size of a buffer.
Buffer size = FDL buffer header + (Field header(4) + Data length + Padding) * Input counts
Data must be aligned on an 8-byte boundary for padding. |
Example
The following shows how to calculate Tmax FD values.
F1 integer F2 long F3 float F4 double F5 STRING length 10 F6 STRING length 19 F7 CARRAY length 22
The buffer size is calculated based on 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
Based on the buffer usage calculation method, a 179,200-byte buffer is required to send 200 records.
fdl buffer header(8) + (length of a record * count) 8 + (112 * 200) = 179200 byte
2. Tuxedo FML16 Calculation Method (Tuxedo 6.4)
The following shows how to calculate the buffer size based on the field type.
Filed Type | Size |
---|---|
String |
Header 4 bytes, Null 1 byte |
Carray |
Header 4 bytes |
Char |
Header 2 bytes, Data 2 bytes |
Short |
Header 2 bytes, Data 2 bytes |
Long |
Header 2 bytes, Data 4 bytes |
Float |
Header 2 bytes, Data 4 bytes |
Double |
Header 2 bytes, Data 8 bytes |
FML16 uses 2 bytes for both the header field and the data field, while FML32 and Tmax use 4 bytes for these fields. In FML32, the calculation method results in a small difference between the field descriptor (FD) size and the actual data size. In contrast, FML16 shows a more significant difference. When migrating from Tuxedo to Tmax, the field buffer size must be calculated accurately. |