Skip to main content

Problem:

In some versions of COBOL (namely AS/400) calling an array and setting the table index to zero works. However, in Micro Focus COBOL this returns an error ("153 subscript out of range") as the default value is set to one.

In order to maintain compatability with other mainframe dialiect it is possible to modify the default setting to zero.

Resolution:

A program would compile correctly with the default directives:

       1 ind-2 usage index.

       1 t1 occurs 10 indexed by ind-1.

           3 pic xxxx comp-5.

          set ind-1 to 0

          set ind-2 to 0

Old KB# 4269