IEEE binary floating point in Enterprise COBOL

Technote (FAQ)


Question

Can you use the IBM Enterprise COBOL for z/OS USAGE IS COMPUTATIONAL-2 hex floating point (HFP) as a binary floating point (BFP)?

Cause

The ANSI 2002 standard documents the clause ARITHMETIC IS STANDARD-BINARY.

Answer

The current ANSI 1985 versions of Enterprise COBOL for z/OS 4.2.0 and 5.1.0 do not support BFP; they only support HFP.

You will have to write an assembler program to convert.

Example:

01 BFP  PICTURE X(8).
01 HFP  COMP-2.
   CALL "BFP2HFP" USING BFP GIVING HFP.
   CALL "HFP2BFP" USING HFP GIVING BFP.

  • Your assembler program BFP2HFP will use the instruction THDR.
  • HFP2BFP will use TBDR as documented in chapter 9 of SA22-7832-09, the Principles of Operation.
  • Be sure both HFP and BFP are double-word aligned.

Related information

Principles of Operation

Rate this page:

(0 users)Average rating

Document information


More support for:

Enterprise COBOL for z/OS

Software version:

4.1, 4.2, 5.1

Operating system(s):

z/OS

Reference #:

1619872

Modified date:

2012-12-12

Translate my page

Machine Translation

Content navigation