bug-gnucobol
[Top][All Lists]
Advanced

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

[open-cobol-list] Re: Bug Report and Bug Fix


From: Roger While
Subject: [open-cobol-list] Re: Bug Report and Bug Fix
Date: Sun Apr 2 23:15:02 2006

ID is also accepted by MF (MicroFocus) and ACU.
Note the complete phrase is optional (as per 2002 standard).

COMP-5 is native machine representation of binary numbers.
ie. The field has the native endianness of the machine allowing
optimized native manipulation of these fields.
COMP (aka. BINARY) is always big-endian and therefore has
to be byte-swapped on little-endian machines (eg. Intel).
Note the standard does not require this but all implementations
(except TC) do this.
Note on a big-endian machine COMP-5 == COMP.
COMP-5 was mentioned in the very early XOpen standard
and has been supported by MF at least way back to
MF Level II ET days.
The 2002 standard whilst not defining the COMP-(n) variants
does have equivalents :
For COMP-5 :
BINARY-CHAR
BINARY-SHORT
BINARY-LONG
BINARY-DOUBLE
each optionally followed by SIGNED (default) or UNSIGNED.
For COMP-3 :
PACKED-DECIMAL
For COMP-1 :
FLOAT-SHORT
For COMP-2 :
FLOAT-LONG

The sign display is affected by by compile options.
If you use one of the "-std=" options mvs, mf, bs2000 or
ibm, then the sign will not be displayed for non-signed
fields. (config option pretty-display in config/xxxx.conf)
Advantage OC.

Also note that regarding the bug, the code would only get
used/activated when specifying one of the "-std=" options
mvs, bs2000, mf or ibm (config option binary-truncate
in config/xxxx.conf)

As regards the "-std=" options, it is worth taking a look
at the files in the "config" directory. "default.conf" has
all the default settings with brief descriptions. This file
is included by the other conf files which then override
specific options.

Roger

John wrote :
Well, I have some suggestions. First instead of ID DIVISION,
which is an IBM variation, I would spell out IDENTIFICATION
DIVISION. Second DISPLAY usage is called that for a reason. I
don't remember what COMP-5 represents (In my day we had COMP and
COMP-3 as the usual choices) but it is obviously not DISPLAY. And
it is not in the recent standards.

Tiny COBOL didn't like the GOBACK in a standalone program
(neither do I) but by substituting STOP RUN it compiled and ran
OK. The only difference between OPEN COBOL and TINY was that the
display of C1 was shown signed in OPEN and unsigned in TINY.
Since the field itself was unsigned I say advantage TINY.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]