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-)
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.