Page 1 of 1

What is the maximum number of digits allowed in COMP-3?

Posted: Mon Jul 30, 2018 12:51 pm
by Suresh TCS
Hi,

What is the maximum number of digits that can be used for the declaration of COMP-3 Field? For example S9(xx) COMP-3?

Re: Wha tis the maximum number of digits allowed in COMP-3?

Posted: Mon Jul 30, 2018 2:01 pm
by nicc
As described in the COBOL Language Reference manual.

Re: Wha tis the maximum number of digits allowed in COMP-3?

Posted: Mon Jul 30, 2018 2:15 pm
by Anuj Dhawan
The default answer is that (xx) can be replaced with (18) BUT it depends on the compiler option in effect. If the ARITH(COMPAT) compiler option is in use 18 digits is the answer. However, if the ARITH(EXTEND) compiler option is in effect, one can use 31 digits, S9(31) COMP-3.

Hope this helps.