-1

As we know Cobol has max support for numbers up to 18 digits. This can be extended to 31 digits with ARITH(EXTEND).

IBM - ARITH option syntax

If I try to declare variable with 23 digits 01 NUM31 PIC 9(23).

I am getting error: COBCH0213S Item is longer than USAGE allows or contains too many numeric positions : C:\fileSample.CBL(56,26)

I had tried to add a command from the link at top of the file ARITH(EXTEND) but without results - getting error: COBCH0143S Unknown IDENTIFICATION DIVISION paragraph

I am using Microfocus Net Express 4.0 as a development IDE.

Ivke
  • 1
  • It's a compiler option, not a program statement. Read your link. – user207421 Feb 12 '21 at 10:14
  • You cannot simply use all IBM options with MF - this one likely has an appropriate compiler directive which can be `$SET` in the first program line. ... and neither of both *is* COBOL and neither of those implemented even COBOL2002 fully (so they are COBOL85 + Extensions). – Simon Sobisch Feb 12 '21 at 11:31
  • How I can pass this argument from the program? Do I can do something like that from Next Express IDE? – Ivke Feb 12 '21 at 14:10

1 Answers1

0

There is no actual standard for max sizes in COBOL. It depends on the compiler. The link you show refers to an option for an IBM mainframe compiler which normally supports 18 digits in a binary or decimal number, but, can be extended to 31 using the documented option.

However judging by the error message you are using a completely different implemenation from Micro-Focus, which, according to this should support 38 digits by default as long as you do NOT specify ANSI85 or ISO2000 dialects.

https://www.microfocus.com/documentation/visual-cobol/vc60/DevHub/HRPGRHPROG0A.html

James Anderson
  • 27,109
  • 7
  • 50
  • 78