Re: COMP and COMP-3 fields

From: Roger (sudhakarkreddy_at_yahoo.com)
Date: 05/25/04


Date: 24 May 2004 22:35:07 -0700

Arnold Trembley <arnold.trembley@worldnet.att.net> wrote in message news:<t1gsc.21673$fF3.557761@bgtnsc05-news.ops.worldnet.att.net>...
> Roger wrote:
> > Hi,
> >
> > I would like to know what is the maximum and minimum value that can be
> > stored in the following declarations and how?
> >
> > 1. VAR1 PIC S9(03) COMP-3.
> > 2. VAR2 PIC S9(04) COMP.
> > 3. VAR3 PIC 9(03) COMP-3.
> > 4. VAR4 PIC 9(04) COMP.
> >
> > It would be of great help, if anybody can answer to me on this.
> >
> > Thanks,
> > Sudhakar
>
> Assuming IBM mainframe COBOL, which seems likely given the COMP-3,
> which is usually IBM packed decimal, making COMP likely to be IBM binary:
>
> 1. Integer values from -999 through +999.
> 2. Depends on the TRUNC compile-time option, but integer -9999
> through +9999 for sure, possibly -32767 through +32767.
> 3. Integer values from 000 through 999.
> 4. Depends on the TRUNC compile-time option, but 0000 through 9999
> for sure, possibly 00000 through 65535.
>
> My answer for #2 is debatable, due to two's complement of the lowest
> negative number.
>
> I hope that helps!

Thanks very much!!

I still have few questions, in the program i am debugging it is right
now able to store 18981 in the S9(04)comp field.

So, can you please let me know how do i find out what should be the
COMP declaration if i have to store a value of 45000....

Also i heard that in S9(04) we can store a value of up to 65635
eventhough we declared as s9(04) COMP....this is because COMP fields
do not care the sign field if it is having positive value...

Please clarify...

Thanks,
Sudhakar



Relevant Pages

  • Re: COMP and COMP-3 fields
    ... |>> stored in the following declarations and how? ... |> Assuming IBM mainframe COBOL, which seems likely given the COMP-3, ... |> which is usually IBM packed decimal, making COMP likely to be IBM ... | COMP declaration if i have to store a value of 45000.... ...
    (comp.lang.cobol)
  • Re: Comping for your meal
    ... the chain store was closing one of its outlets. ... There were big signs everywhere insisting that all sales were final, that there were no returns, to check carefully before making purchases because everything was as-is, etc. ... I know restaurant owners comp meals because they're afraid they'll get a bad reputation from patrons who will tell all their friends that they had a bad time. ...
    (rec.food.cooking)
  • Re: why does my comp remember names?
    ... WildCat had this to say: ... My reply is at the bottom of your sent message: ... > get my comp to not store all these names or remember them,Fraustrated ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Would you like to tell me where to buy a cheap IBM laptop batteries with good quality?
    ... and I want to buy a replacement battery for my IBM ... would like to know more on-line store in United Kingdom. ...
    (uk.comp.misc)
  • Re: Re: Would you like to tell me where to buy a cheap IBM laptop batteries with good quality?
    ... and I want to buy a replacement battery for my IBM ... would like to know more on-line store in United Kingdom. ...
    (uk.comp.misc)