• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

conversion from decimal to packed BCD

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is there some java library or method that handles conversion from decimal to packed BCD and vice versa? I am supposed to write code that does that.

Thanks
val
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

I'm not aware of anything to do that, but you could Google and see. I haven't looked to see the real definition of BCD ... are you converting to/from IBM mainframes where 123 would be, um, x'f123'? We've had other questions about that in the past ... you might try the ranch search tool on the first few Java In General forums and see what you hit.
 
Valerie Waters
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply!!
I was wondering if there's a Java routine/method that handles BCD to decimal conversion and/or vice versa. I did not get much help from the searching the forums...
 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could try using the AS400PackedDecimal class from "IBM Toolbox for Java".
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/info/rzahh/javadoc/com/ibm/as400/access/AS400PackedDecimal.html

You can download opensource version of these classes from here.
http://jt400.sourceforge.net/

James.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We use the mentioned approach (not surprisingly as we implement for the AS400 system). For converting we use the (among others) AS400DataType and the AS400PackedDecimal.
reply
    Bookmark Topic Watch Topic
  • New Topic