Reference modifier range error message



When a program has code like this:

move abc(x:y) to xxx

and y's value is 0, it generates the following error:

Reference modifier range error; start = 31, length = 0 Reference modifier range error; start = 31, length = 0 Reference modifier range error; start = 32, length = 0

Is there a way to turn off this error message?


The configuration variable WARNINGS can be used to supress these types of messages (see ACUCOBOL-GT Appendices > Appendix H: Configuration Variables > H.2 Configuration variables > WARNINGS.

There are 3 possible settings.  An excerpt of the documentation is here:

------------------------------------------------------------------------------------------------------------------ ---

WARNINGS can take the following values:

0  (off, false, no) No warning is printed.

1  (on, true, yes) A warning is printed. This is the default.

2  A warning is printed or sent to the error file. If you are in the debugger, an automatic breakpoint occurs.

3  For a non-numeric error, a warning is printed, an intermediate error is generated that calls the installed error procedures, if any, and the runtime is halted. For more information on error procedures, see CBL_ERROR_PROC Routine in Appendix I.

Note: The setting you select for WARNINGS applies to reference modifier range errors when the start plus length reference is past the end of the item. Reference modifiers that are equal to or less than zero are always silently corrected as described above.

------------------------------------------------------------------------------------------------------------------ ---

Old KB# 2763
Comment List