Re: Identifting sign in COMP data



"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



.



Relevant Pages

  • Re: Javas performance far better that optimized C++
    ... Although all of the above programming ... like an operating system. ... practice and theory are the same - in practice they are not. ... I'm sure there are Java extensions which may allow things ...
    (comp.lang.cpp)
  • Re: Necessity of Deallocate/Close statements at end of program?
    ... The lecturer who taught us the Fortran ... Speaking of "good practice", unrelated to Fortran (but related to ... problems in normal operation of a general purpose operating system. ...
    (comp.lang.fortran)
  • Re: Files on Desktop?
    ... HAHAHA now that is some funny stuff... ... Ohh and by the way, ... > A agree it is a bad practice, but I have seen a desktop with so many ... >> operating system? ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Files on Desktop?
    ... A agree it is a bad practice, but I have seen a desktop with so many ... file and folder they stretched across two or three 19" monitors. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Newbie Question: As I upgrade OS systems, can I delete older ones?
    ... As with Windows or any other operating system, the best practice is to ... start fresh with whatever OS you're going to use. ... The upgrade from 9 to ...
    (comp.sys.mac.system)