Is there an existing gem or script that converts comp-3/packed decimal format to number?

559 Views Asked by At

I'm starting a new adventure to convert COBOL program to a Ruby program, I have to convert a a comp-3/packed decimal format to number.

From another previous post, there is code that would convert from a number to comp-3, but not the inverse.

1

There are 1 best solutions below

3
On

COMP-3 is typically an IBM only method of packed decimal. I have had issues in the past converting the packed decimal on IBM to other formats. I would normally have to pad my destination size by a byte to get the sizes to match up.

I'm not aware of any COMP conversion programs or utilities that would help you on this.