For Programmers: Free Programming Magazines  


Home > Archive > Cobol > July 2004 > COMP-?: (was: In answer to RW - again (was: Sorts (revised)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author COMP-?: (was: In answer to RW - again (was: Sorts (revised)
William M. Klein

2004-07-12, 3:56 pm

The history of "comp" in IBM (not other) compilers goes back to a statement that
I was TOLD was in earlier Standards (before the '85 Standard - and possibly JUST
in the '68 one, not the '74). It said something along the lines of
"COMPUTATIONAL is the 'most efficient' for arithmetic/computational statements".

Therefore,
IBM "mainframes" (MVS, VSE, VM, etc) used BINARY for COMP (computational)
IBM S/3? (3, 36, 38, os/400, etc) used PACKED-DECIMAL for COMP

In addition (for "portability" across *IBM* systems)

COMP-3 is *always* packed-decimal
COMP-4 is *always* binary

With the '85 Standard, USAGE PACKED-DECIMAL and BINARY "solved" some of this,
but much of the COMP-n code and coding is still in use (and being used by new
development in IBM shops).

It was only "later" that COMP-5 was added - when "big-endian" vs "little-endian"
binary issues were introduced. I *think* but won't swear to it that COMP-5 with
all current IBM compilers (that support it) is whatever is "native" binary *and*
it ignores PICTURE truncation (i.e. is equivalent to the older "NOTRUNC"
option - but on a field by field basis).

--
Bill Klein
wmklein <at> ix.netcom.com
"Chuck Stevens" <charles.stevens@unisys.com> wrote in message
news:ccucig$2toe$1@si05.rsvl.unisys.com...
>
> "Robert Wagner" <robert.deletethis@wagner.net> wrote in message
> news:40edcba5.978259@news.optonline.net...
>
>
> other
> while on
>
> According to what I see, COMP-4 is the same as COMP -- halfword binary for 1
> through 4 digits, fullword binary for 5 through 9 digits, doubleword binary
> for 10 through 18 digits, with the leading bit containing the sign.
>
> I'm not sure what COMP-4 is to be presumed the other way around *from*,
> since the basis for my description of COMP-4 dates from a 1973 DOS/VS COBOL
> reference manual, which I suspect predates a time in which the distinction
> between "big-endian" and "small-endian" had shown up on the radar of
> programmers at most mainframe shops! COMP-4 seems significantly to predate
> COMP-5, and I'd expect the latter to be a variant of the former.
>
> -Chuck Stevens
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com