COMP-? / Extension USAGEs (was: The redefines clause & comp-3

IBM (all platforms and compilers that I know of) have "COMP-3" (as an extension)
= "Packed-Decimal" (USAGE Packed-Decimal was made Standard in '85 Standard).

Many implementors "emulated" this for compatibility with IBM (as they did for
many other IBM extension) in the relatively early days of COBOL.

As Chuck indicates below, COMP-3 (if supported at all) could be equivalent to
BINARY, DISPLAY, or NATIONAL or anything else.

Although I (personally) know of some implementations with other USAGES
equivalent to "Packed-Decimal" - I don't (personally) know of any implementation
that supports COMP-3 where it is NOT Packed-Decimal. I would be curious if
there are some/any.

Other IBM (extension) usages are NOT as universal.
COMP-1 and COMP-2 are floating point for IBM, but are occasionally other
usages for other compilers
COMP-4 isn't universal even across IBM platforms. (It is Binary on mainframe
and Packed-Decimal on OS/400)

For "workstation" compilers, it is common for COMP-5 to be a "native" binary
(recently adopted by IBM)
More than one vendor has COMP-6 as Packed-Decimal with NO sign-nibble (when no
"S" in Picture)


Even for USAGE Packed-Decimal and Binary, the Standard doesn't "dictate" exactly
how the data is stored - only what "radix" must be used.

Bill Klein
wmklein <at>
"Chuck Stevens" <charles.stevens@xxxxxxxxxx> wrote in message
> "Walter Murray" <wmurray@xxxxxxxxxxx> wrote in message
> news:1123524913_71@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> WARNING: The rules about what constitutes a valid sign nibble, and how
> that
>> nibble is interpreted, are entirely dependent on the implementation. The
>> rules given above are not universal. See your particular compiler's
>> documentation for details. (Hint: You'll probably find this documented
>> under the USAGE clause.)
> Indeed, the very existence of "COMP-3" in the language is dependent on the
> implementor; the '68, '74, '85 and '02 standards are silent on the subject
> of COMP-anything other than just plain COMPUTATIONAL. It's not just what
> constitutes a "sign nibble" in COMP-3 and how it's interpreted that's
> implementor-defined, it's the very meanings of "nibble" and "COMP-3" in the
> first place.
> -Chuck Stevens