Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computational, COMP-5

Status
Not open for further replies.

fabiousa

MIS
Aug 13, 2001
45
BR
Guys,

If I have field definitions of:

ABC PIC S9(18) COMP-5 and
XYZ PIC S9(8) COMP-5,

Why would I get in real size ABC 10 bytes and XYZ 4?
Also, how can I calculate the size allocation for all the COMPS?

Thanks,

Fabio
 
I have only heard of comp 1,2 and 3. What is comp 5?::)
 
Just correcting it, if I have ABC S9(18) I get an actual size of 8 and not 10 as I would with COMP-3. I've read somewhere that when you specify COMP-5, the only values are 2, 4 and 8, regardless the size of the PIC clause. Is this right? X-)
 
Hi,

if you are ever in doubt of a size, use the COBOL expression LENGTH OF to know it for sure.

COMP-5 depends on where it is used. On the IBM mainframe, it is the same as COMP-4 with compilation option TRUNC(OPT) which means that it can have a value up to +32767 although it has 4 digits.... :)

COMP-5 on the PC is usualy the INTEL format, so the lowest value in front, the other way around compared to BINAIRY.

COMP-5 stands for native format.

On the mainframe, only sizes of 2, 4 or 8 bytes are allocated: hafword, fullword and doubleword.

But again, a native format depends on the COMPILER provider and the platform where it is running on. No guarantee

I hope this is helpful.

Regards,

Crox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top