Re: Identifting sign in COMP data




"kimi" <mraghu83@xxxxxxxxx> wrote in message
news:1183006609.523437.181340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi ppl,
Can anyone tell me how to recognize whether the COMP
variables are negative or positive.
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.

Similarly how can we recognize whether the number is positive or
negative in COMP , COMP-1 and COMP-2 data.

For IBM mainframe and Micro Focus, COMP is
the same as BINARY. The most significant bit of
the most significant byte is the sign.

For IBM mainframe, COMP-1 and COMP-2
floating-point items, the most significant bit of
the most significant byte is the sign.

For Micro Focus, COMP-1 and COMP-2
floating-point items in IEEE format on Intel-type
processors, the most significant bit of the least
significant byte is the sign.

For COBOL, "we" use a conditon, such as,
IF ITEM IS NEGATIVE
...
END-IF
..



.



Relevant Pages

  • Re: Identifting sign in COMP data
    ... Can anyone tell me how to recognize whether the COMP ... For instance in COMP-3 data, if the last nibble is 'C' then we say it ... Is this part of your project to read COMP-1 and COMP-2 data from your ... If you run into range issues with your COMP-1 data, go with one of my earlier suggestions about splitting the floating point value into an exponent and a mantissa. ...
    (comp.lang.cobol)
  • Re: Identifting sign in COMP data
    ... Can anyone tell me how to recognize whether the COMP ... For instance in COMP-3 data, if the last nibble is 'C' then we say it ... Is this part of your project to read COMP-1 and COMP-2 data from your ...
    (comp.lang.cobol)
  • Re: Identifting sign in COMP data
    ... On Jun 28, 1:36 pm, Louis Krupp ... Can anyone tell me how to recognize whether the COMP ... Is this part of your project to read COMP-1 and COMP-2 data from your ...
    (comp.lang.cobol)
  • Re: Identifting sign in COMP data
    ... Can anyone tell me how to recognize whether the COMP ... Do you actually have COMP-3 data in which the last nibble is 'F' and this indicates a negative number? ... Is this part of your project to read COMP-1 and COMP-2 data from your mainframe? ...
    (comp.lang.cobol)
  • Identifting sign in COMP data
    ... Can anyone tell me how to recognize whether the COMP ... For instance in COMP-3 data, if the last nibble is 'C' then we say it ... negative in COMP, COMP-1 and COMP-2 data. ...
    (comp.lang.cobol)