retrieve cobol s9(2) COMP onto C variable
Posted
by
Pablo Cazallas
on Stack Overflow
See other posts from Stack Overflow
or by Pablo Cazallas
Published on 2011-01-04T08:41:43Z
Indexed on
2011/01/04
11:54 UTC
Read the original article
Hit count: 536
Hi,
I need to retrieve data from a COBOL variable of the type: "PIC S9(2) COMP" onto a C variable of the type "int".
It's stored using two bytes of a string, so I receive it as a couple of chars.
I know COBOL stores decimal data onto a "S9(2) COMP" in binary format, so It would be a great help letting me know any algorithm or way to convert it safely.
Any kind of help & suggestion will be welcome.
Thanks in advance and regards,
Pablo.
© Stack Overflow or respective owner