convert Regular decimals to Packed decimals

Hi,

I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round.

If not unix please let me know if any other progrimming language I can use to do this.

Thanks.

Hi.

If you are comfortable in perl, there is this module at http://cpan.org/:

Convert::IBM390 -- functions for manipulating mainframe data

providing, for example:

You might also Google for packed decimal unix

I have used a COBOL compiler on Linux: OpenCOBOL - an open-source COBOL compiler ... cheers, drl

There are a number of different types of packed decimals. If you want IEEE 754r:2008 types have a look at the decPacked module in the IBM decNumber library alphaWorks : decNumber : Overview. It is witten in ANSI C.