File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conversion from decimal to packed BCD

 
Valerie Waters
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
James Swan
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
bart zagers
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic