Need some python help (or maybe C )

Kurt Wall kwall at kurtwerks.com
Sat Dec 13 21:18:39 PST 2008


On Sat, Dec 13, 2008 at 11:40:58AM -0600, Ben Duncan wrote:
>
> I have a hex value as x'000123456D". It is a COMP-3 (Binary coded decimal)
> for a cobol program. That says to me and is in actuality the number 123456-,
> The LAST nibble D is negative and F or C would be postive.
>
> I need to get this to a "integer" or a string.

$ perl -e 'print unpack("I", 0x000123456D), "\n";'
942684465

Kurt



More information about the Linux-users mailing list