Converting Packed Decimal in C++

S

Spufi

I have read several messages on converting packed decimals (EBCDIC) in
a C++ program, but they were all for AS400 systems. I am looking for a
way to convert the packed decimals in a COBOL program that is on a MVS
(z/OS) system in a C++ program. Anyone have any idea how to do this? Is
there a header or class that will do this?? Thanks in advanced!!
 
M

mlimber

Spufi said:
I have read several messages on converting packed decimals (EBCDIC) in
a C++ program, but they were all for AS400 systems. I am looking for a
way to convert the packed decimals in a COBOL program that is on a MVS
(z/OS) system in a C++ program. Anyone have any idea how to do this? Is
there a header or class that will do this?? Thanks in advanced!!

I'm not sure what you're asking. Are you saying that you have an EBCDIC
string that you want to convert to an ASCII string (or perhaps to a
number)? Please restate the question more clearly.

Cheers! --M
 
J

Jim Langston

Spufi said:
I have read several messages on converting packed decimals (EBCDIC) in
a C++ program, but they were all for AS400 systems. I am looking for a
way to convert the packed decimals in a COBOL program that is on a MVS
(z/OS) system in a C++ program. Anyone have any idea how to do this? Is
there a header or class that will do this?? Thanks in advanced!!

Are you talking about BCD (Binary Coded Decimal)? I seem to recall the
AS/400 uses that.
 
S

Spufi

Sorry all..let me restate the problem I am running into. I am calling a
COBOL program that is running on an MVS system (z/OS) in a C program.
The COBOL program contains packed decimals (COMP-3 picture fields).
From the documentation I have read, C can handle the conversion but not
C++ (I wonder if C# does?). I was successful working with C, but our
group manager prefers to use C++ if possible. I guess what I am trying
to find out if there is a header or class in C++ that is out there that
reconizes the packed decimal?
thanks all for the help!!!
 
B

Ben Pope

Spufi said:
Sorry all..let me restate the problem I am running into. I am calling a
COBOL program

OK, please bear in mind that we do not, as a rule, understand COBOL in
this newsgroup...
that is running on an MVS system (z/OS)

Nor do we understand MVS on z/OS.
in a C program.

OK, I'll let you have that one, but technically this is also not topical
here.
The COBOL program contains packed decimals (COMP-3 picture fields).

What is a packed decimal? And what is COMP-3?
From the documentation I have read, C can handle the conversion but not
C++

I would find that hard to believe.
(I wonder if C# does?).

Well, also not topical.
I was successful working with C,

Care to post the relevant code? Try to make it as minimal as possible.
but our group manager prefers to use C++ if possible.

Most C code will compile under a C++ compiler.
I guess what I am trying
to find out if there is a header or class in C++ that is out there that
reconizes the packed decimal?

Maybe, maybe not. I can't imagine it's that tricky to pack and unpack,
but we cannot help you unless you tell us what exactly it is you
require. You can't expect us to go and research COBOL, packed decimal
and COMP-3.

Ben Pope
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top