COBOL floating-point revisited



John

If you need a way to support all the IBM HFP and BFP formats including
short, long, and extended formats using just COBOL and Java, then you may
find the open source z390 Portable Mainframe Assembler and emulator tool
useful. It is written entirely in J2SE Java and supports all the problem
state instructions including floating point and the new z9 opcode
additions which include a few new floating point instructions.

z390 uses the Java native float, double, and BigDecimal class to perform
single (32 bit), double (64 bit), and Extended (128) floating point
operations. There are also many useful instructions for converting
between the floating point types and integer, packed decimal, and zoned
decimal. z390 includes a regression test source program TESTFP1 which
performs tests of each floating point instruction. For more information
visit www.z390.org.

Don Higgins
don@xxxxxxxxxxx

<Message from John W. Gilmore>

As many of you know, IBM Enterprise COBOL supports only single- and
double-precision IBM hexadecimal floating-point (HFP) data types. In
particular, it does not support extended-precision HFP or any of single-,
double-, or extended-precision IEEE binary floating-point (BFP) values.

Moreover, it would be fair to say that this support is scarcely missed:
Few
COBOL programmers would make spontaneous use of it if it were available.

Java, on the other hand, makes heavy, very heavy, use of BFP, often in
situations in which it is not even apparent to a naif Java programmer that
it is doing so. My experience in trying to interface a new Java
subsystem
with some existing COBOL routines was thus discouraging.

It was not possible to avoid the use of HLASM interfacing/transmitter
routines, which are not maintainable by COBOL or Java programmers, in
order
to do so.

In the upshot I have had to recommend to my client that it avoid any
future
use of COBOL in many situations; and, while this does not greatly distress
me personally, it does suggest that that the issue of what COBOL should
support is more complicated than many discussions of this issue here have
suggested.

John Gilmore
Ashland, MA 01721-1817
USA

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



Relevant Pages

  • Re: replacing SAS for SMF reports?
    ... which is a decimal floating point ... These classes are pure Java ... Enterprise Cobol Compiler and generate Java classes which use the above ... Java does not have Decimal Floating Point yet, ...
    (bit.listserv.ibm-main)
  • Decimal Floating Point, was: replacing SAS for SMF reports?
    ... awkward in COBOL are bit switches and the 1 byte binary fields. ... COMP-1 and COMP-2 could be retained for hex floating point so a single ... Java does not have Decimal Floating Point yet, ... USAGE BIT and USAGE BINARY-CHARACTER. ...
    (bit.listserv.ibm-main)
  • Re: Cobol2Java: a Cobol to Java source code converter is available for evaluation
    ... If you were suggesting to use a C/C++ to Java tool that I may agree ... better because of being translated to a different language. ... Cobol is far from OO. ... many printers and page format as need at any time. ...
    (comp.lang.cobol)
  • Re: I need help!!
    ... trying to use the java based record editor program on sourceforge to ... Most COBOL environments have utilities available to create standard ... Write a small COBOL program to convert all the packed fields to ... Do you think my Java decimal package will help more people use Java on ...
    (comp.lang.cobol)
  • Re: COBOL and Java Relative Perceived Power
    ... What does COBOL ... 003 classes for Java Support ... is referred to as implementation inheritance. ... I don't think inheritance breaks encapsulation, ...
    (comp.lang.cobol)