473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Converting Packed Decimal in C++

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!!

Mar 3 '06 #1
4 5116
Spufi wrote:
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

Mar 3 '06 #2
"Spufi" <mr*******@dstsystems.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
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.
Mar 3 '06 #3
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!!!

Mar 6 '06 #4
Spufi wrote:
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
--
I'm not just a number. To many, I'm known as a string...
Mar 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Delali Dzirasa | last post by:
I would have a number packed with its hex representation of the integer below is some sample code of what is being done. int value = 20; //in hex it is 0x14 AddData (value); .. .. ..
1
by: tamrakar | last post by:
Please let me know how I can Load a packed decimal date coming from a file from mainframe be loaded into a Oracle table date column? Any help will be appreciated. Thanks,
2
by: Rick Ingham | last post by:
Can anyone point me to an open source library for handling packed decimal numbers from C? I'm looking to be able to integrate Cobol and C modules that both deal with p15 and P19 packed decimal...
3
by: Amaryllis | last post by:
Hi again, I'm new to the world of communicating between VB.NET and AS/400, so I've been posting a lot of questions lately since no one else in the company has done anything like this before. ...
8
by: Mika M | last post by:
Is there better way to convert integer type date into DateTime type date as doing like code below? Dim intDate As Integer = 20051019 Dim dte As DateTime = New DateTime( _...
3
by: Brian Henry | last post by:
Does anyone know of or know how to convert a COBOL packed decimal in a text file to a decimal that .NET can work with? we are importing Old COBOL data files that have packed data in them and need...
3
by: Ven | last post by:
Hi, I want to convert a decimal feild into a packed decimal field in my C++ program. How can I do that ? Is there any functions in C++ that can do that. I am using g++ compiler to compile my...
1
by: gkata | last post by:
I have a file that originated on the mainframe that contains both text and packed fields. I'm using sql loader to load a Oracle table, but I'm having difficulty with the packed fields loading...
4
by: Jeff | last post by:
Hey ..NET 2.0 In my code am I trying to convert an int value into a decimal: decimal d = 0; int k = 87664; d = Convert.ToDecimal(k/100);
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.