473,387 Members | 3,820 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,387 software developers and data experts.

Decimal to Packed Decimal Conversion in C++

Ven
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.

Thanks,
Ven.

Jul 26 '06 #1
3 3150
Ven wrote:
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.
Functions? A whole library of them. I am sure you should be able to
use some of them to achieve your goal. A single function? No single
function for such conversion.
I am using g++ compiler to compile my C++ progrmas.
Doesn't matter here. If you want a compiler-specific answer, please
ask in the compiler-specific forum.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 26 '06 #2
"Ven" writes:
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.
The and and shift operators should be a big help in this. There is not
function in the standard library to do that, but you could probably find a
function on the net someplace. I think the time spent searching and
learning to use what you find and testing the results would be better
invested in "rolling your own". Note that BCD deals with unsigned numbers
that have a sign attached as a separate indicator of some sort.
Jul 27 '06 #3
Ven
Thanks, for your suggestions.

Ven.

osmium wrote:
"Ven" writes:
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.

The and and shift operators should be a big help in this. There is not
function in the standard library to do that, but you could probably find a
function on the net someplace. I think the time spent searching and
learning to use what you find and testing the results would be better
invested in "rolling your own". Note that BCD deals with unsigned numbers
that have a sign attached as a separate indicator of some sort.
Aug 1 '06 #4

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

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
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. ...
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: parag.kanade | last post by:
I have a packet structure which has a field of Integer arrays, that is packed struct { int a; char b; int count; }foo; I need to initialize all the entries of count to a particular value,
4
by: Spufi | last post by:
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...
23
by: neha_chhatre | last post by:
which is the best format specifier(data type) if i have to work with decimal number. also please tell me the syntax for truncating a decimal number please reply as soon as possible
12
by: Frank Millman | last post by:
Hi all I have a standard requirement for a 'decimal' type, to instantiate and manipulate numeric data that is stored in a database. I came up with a solution long before the introduction of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.