Displaying COMP fields

Re: Displaying COMP fields

Postby Robert Sample » Wed Apr 24, 2013 4:04 pm

+1 is stored in the first two bytes. Why doesn't it displays that in Var2.
That is what this shows:
 VAR2 >....<
VAR2 is a 2-byte variable, with the first byte having X'00' and the second byte having X'01' -- the two, together, make a +1. If you do not understand why this is so, you need to click on the IBM Manuals link at the top of this page, open the COBOL Programming Guide manual, and read section on internal representation of numeric variables.
Robert Sample
Global moderator
Posts: 3432
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 239 times

Re: Re: Displaying COMP fields



Return to Interview Questions