I found half of what I want in com.dovetail.jzos.ByteUtil.unpackLong(). Now I just need a longPacked() method.

From: "Jeffrey D. Smith" <[EMAIL PROTECTED]>
Reply-To: IBM Mainframe Discussion List <IBM-MAIN@BAMA.UA.EDU>
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Java packed decimal
Date: Mon, 31 Jul 2006 23:35:00 +0000

============================================
-----Original Message-----
From: "john gilmore" <[EMAIL PROTECTED]>
Sent: 7/31/2006 3:18 PM
To: "IBM-MAIN@BAMA.UA.EDU" <IBM-MAIN@BAMA.UA.EDU>
Subject: Re: Java packed decimal

Benjamin White writes:

|  Yes, I have been considering extending java.math.BigDecimal.  My first
Java Z/series programs
|  have converted the packed decimal byte array to Unicode for display.

and I am much impressed.  I hope the two single machine instructions

o PKU, PacK Unicode, and

o UNPKU, UnPacK Unicode,

figured at least implicitly in this horrendous effort.

As I noted earlierJava does much of its arithmetic in BFP, some of under the
covers; and the notion of converting PD values into BFP for use in C/C++ or
Java environments, while it can certainly be characterized, even
stigmatized, as a standard practice, is also a good one, the best one at
least until ASCII DFP becomes available on z/Architecture machines.

John Gilmore
============================================

I suggest writing a new class that has one or more factory
methods for creating a BigDecimal from an array of byte. Don't
extend BigDecimal.

2 cents worth. your mileage may vary.


Jeffrey D. Smith
Farsight Systems Corporation
24 BURLINGTON DR
LONGMONT, CO 80501
303-774-9381 direct
303-709-8153 cell
303-484-6170 fax

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to