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: 3363
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 221 times

Re: Re: Displaying COMP fields

 

Previous

Return to Interview Questions