473,586 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5148
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*******@dsts ystems.com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.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
7655
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
5526
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
2282
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 numbers. Rick. -- comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must have an appropriate newsgroups line in your header...
3
3844
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. Hopefully, this one is fairly simple. I'm trying to insert records into a table on the 400. I can insert into a packed field that has no decimal...
8
2478
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( _ CType(intDate.ToString.Substring(0, 4), Integer), _ CType(intDate.ToString.Substring(4, 2), Integer), _ CType(intDate.ToString.Substring(6, 2), Integer))
3
7370
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 to convert it to a form we can use. thanks!
3
3161
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 C++ progrmas. I appreciate your help.
1
2595
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 correctly. I've been trying several options in the control file, but none seem to work: ODOMETER_READING POSITION (65:68) DECIMAL (6,0), Any help is...
4
3448
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
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.