Page 2 of 2

Re: Displaying COMP fields

PostPosted: Wed Apr 24, 2013 4:04 pm
by Robert Sample
+1 is stored in the first two bytes. Why doesn't it displays that in Var2.
That is what this shows:
 VAR2 >....<
4ECDF4600004
051920E0100C
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 1.3.4.7 on internal representation of numeric variables.