how to use UDT in Visual Basic to depict COBOL Decimal Comp-3?
COBOL Decimal Comp-3(precision, scale, size) are list in the following.
(15,5,8) (9,0,5) (11,0,6) (17,5,9) (11,2,6) (3,0,2) (13,5,7) (7,0,4) (11,5,6)
For example, in the Invent.btr(This btr file come from business vision), the definition of fields is following:
(Field, Data Type, Size, Precision, Scale)
(I_WHSE,Char,2)
(I_PART_NO,Char,15)
(I_DESCRIPTION,Char,40)
…..
(I_COST_CURRENT,Decimal,8,15,5)
…..
I use the UDT below in Visual Basic:
Public Type InvFull_Fld
I_WHSE As String * 2
I_PART_NO As String * 15
I_DESCRIPTION As String * 40
I_Filler1 As String * 16
I_COST_CURRENT As Double
I_Filler2 As String * 967 ' total 1048
End Type
Note I use double data type to depict I_COST_CURRENT field, this field is a decimal(15,5,8) field (here 15 is precision , 5 is scale, and the betrieve size is 8). but when I use this UDT to get the record with Betrieve API, the result is wrong, for example, actually the original data is 0.00000 , and what I got is 6.98350748929955E-251
Thanks.
COBOL Decimal Comp-3(precision, scale, size) are list in the following.
(15,5,8) (9,0,5) (11,0,6) (17,5,9) (11,2,6) (3,0,2) (13,5,7) (7,0,4) (11,5,6)
For example, in the Invent.btr(This btr file come from business vision), the definition of fields is following:
(Field, Data Type, Size, Precision, Scale)
(I_WHSE,Char,2)
(I_PART_NO,Char,15)
(I_DESCRIPTION,Char,40)
…..
(I_COST_CURRENT,Decimal,8,15,5)
…..
I use the UDT below in Visual Basic:
Public Type InvFull_Fld
I_WHSE As String * 2
I_PART_NO As String * 15
I_DESCRIPTION As String * 40
I_Filler1 As String * 16
I_COST_CURRENT As Double
I_Filler2 As String * 967 ' total 1048
End Type
Note I use double data type to depict I_COST_CURRENT field, this field is a decimal(15,5,8) field (here 15 is precision , 5 is scale, and the betrieve size is 8). but when I use this UDT to get the record with Betrieve API, the result is wrong, for example, actually the original data is 0.00000 , and what I got is 6.98350748929955E-251
Thanks.