Re: Identifting sign in COMP data
- From: "Michael Mattias" <mmattias@xxxxxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 09:23:37 -0500
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:rfg783p44bhf4hq5iuscr3r865vl7438qc@xxxxxxxxxx
On Thu, 28 Jun 2007 04:32:05 -0400, "Rick Smith" <ricksmith@xxxxxxx>
wrote:
For instance in COMP-3 data , if the last nibble is 'C' then we say it
is positive and if it is 'D' or 'F' we say it is negative.
Actually 'F' is unsigned, assumed positive.
That was because the way they stored unsigned numbers
changed with the operating system. Same CoBOL, but the operating
system changed how the numbers were stored.
IIRC, "COMP" or "COMP-[anything'"] is always "implementor-defined" and the
only COBOL-defined storage you can absolutely assume will be the same across
platforms/operating systems are USAGE PACKED-DECIMAL (BCD) and USAGE BINARY.
In practice of course, compiler publishers will never change the storage for
"COMP[-anything]" data in their products, but as Mr. Brazee's example
demonstrates, the operating system may have an impact on it.
--
Michael C. Mattias
Tal Systems Inc.
Racine WI
mmattias@xxxxxxxxxxxxxx
.
- References:
- Identifting sign in COMP data
- From: kimi
- Re: Identifting sign in COMP data
- From: Rick Smith
- Re: Identifting sign in COMP data
- From: Howard Brazee
- Identifting sign in COMP data
- Prev by Date: Re: Identifting sign in COMP data
- Next by Date: Re: Identifting sign in COMP data
- Previous by thread: Re: Identifting sign in COMP data
- Next by thread: Re: Identifting sign in COMP data
- Index(es):
Relevant Pages
|