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 >....<
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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Previous

Return to Interview Questions