Comp internal representation

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Comp internal representation

Postby coollearner » Sat Jun 05, 2010 6:00 pm

Can I know how the following data item is stored:

01 PIC s9(4) COMP

I have supplied the value as -1234

I want to know the internal representation of the data
Knowledge is wealth
Posts: 33
Joined: Thu Jun 03, 2010 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Comp internal representation

Postby enrico-sorichetti » Sat Jun 05, 2010 6:15 pm

the cobol manuals and the IBM principle of operations will tell everything You might want to know ... ppls2.html
for the COBOL stuff
any version/release will do, data representation description does not change )
for the POP ( Principles of Operations) SA22-7832-07
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Global moderator
Posts: 2978
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 160 times

Re: Comp internal representation

Postby dick scherrer » Sat Jun 05, 2010 8:13 pm


One way to check any value is to force a dump and look at the value in the dump. To make it easy to find your value of interest in the dump, put an "eye-catcher" before and afterthe field.

Something like:
01  my-stuff.
    05 eyecatch1    pic x(16) 'before the value'.
    05 the-value    pic s9(4) comp value -1234.
    05 eyecatch2    pic x(15) 'after the value'. 
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Return to IBM Cobol


  • Related topics
    Last post