[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Potential modifications to COBOL relative to IEEE 754

I'm curious however how a programmer would write their code to run with
best performance on either BID or DPD platforms ...

Aside from the ARITHMETIC clause in the OPTIONS paragraph of the
IDENTIFICATION DIVISION, the source code is EXACTLY the same whether
the arithmetic mode specifies binary or decimal encoding.

The implementor would certainly be free to build object code for BOTH
modes, and to build into the compiled object code do an inquiry at
the beginning of execution to find out which mode to use at run time.

It is that one line of IDENTIFICATION DIVISION that I was concerned about,
i.e. source code portability and not object code portability.

Perhaps having to edit the IDENTIFICATION DIVISION for each platform is
considered normal in COBOL, and does not count as a source change.  In
that case my concern is indeed moot.  As I said, my recollections about
COBOL date back to 45 years ago, and even back then I only used COBOL
(in French, actually) in homework assignments.

Languages like C deal with environmental considerations by inclusion
of standard header files, which can define platform-specific types, and
compiler options can take care of such issues as well.  This allows the
source code to be left unchanged when compiling on different platforms.
Perhaps something similar exists for COBOL too.

---Sent: 2011-02-26 22:38:06 UTC

754 | revision | FAQ | references | list archive