Displaying COMP fields

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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:

Code: Select all

 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.


  • Similar Topics
    Replies
    Views
    Last post