Board index » delphi » comp and comp-3

comp and comp-3

I need to convert some old (cobol) data files, but I am stuck with
these bin fields. How can I convert it to strings??
tia.

"the myra team"

download your free screensaver from http://www.webrasilia.com.br/myra/myra.htm

 

Re:comp and comp-3


Quote
jorge wrote:

> I need to convert some old (cobol) data files, but I am stuck with
> these bin fields. How can I convert it to strings??

COBOL COMP is a 16 or 32bits signed binary number (I don't remember
if also 64bit numbers are allowed), negative numbers are in two's
complement (-1 is all ones etc.)

COBOL COMP-3 is "packed decimal", that is each decimal digit takes
4 bits. The total number of bits is always a multiple of 8, and the
rightmost 4 bits form the sign where 1100 (preferred), 1010, 1110
and 1111 all are interpreted as plus, while 1101 (preferred) and
1011 are interpreted as minus.

hope this helps
regards Sven

Other Threads