Skip to main content

This article explains why the RTS 153 error occurs when attempting to access a data item with an occurs clause.

Problem:

This error occurs when attempting to access a data item with an occurs clause. The subscript value at time of the error exceeds the defined maximum occurence value contained in the definition of the item. This application does not fail on the mainframe and fails after migration to a UNIX operating system.

Resolution:

Compile the program using the generator directive -N NOCHECK.

The -N indicates that this is a directive that will be passed to the Micro Focus native code generator

The CHECK directive turns on all run-time checks in generated code. The run-time checks include checks for:

Divide-by-zero

Calling invalid (that is NULL) procedure-pointers

Recursion of non-recursive programs

NOCHECK disables all run-time checks in generated code. The NOCHECK option sets the compiler directives NOBOUND, NOLINKCHECK, NOPARAMCOUNTCHECK, and NORECURSECHECK.

The BOUND directive specifies that subscript or index values are to be checked at execution time to ensure they are within the limits defined by their OCCURS clause. The NOBOUND directive disables this checking.

The LINKCHECK directive specifies that each time a Linkage Section item is referenced a check is to be made that it exists. If this directive, is set then for any reference to a Linkage Section item that does not exist a run-time error 203 (CALL parameter not supplied) is generated. NOLINKCHECK disables the checking of Linkage Section items at execution time.

The PARAMCOUNTCHECK directive enables the program to be called with fewer parameters than are specified in the relevant entry point's USING clause. This directive must be used if any of the following apply:

The program is called with a variable number of parameters.

The program contains a Linkage Section, and is to be used both as a main program run from the command line and as a subprogram called from another program.

The program is compiled with STICKY-LINKAGE"2" specified.

Otherwise the program can be compiled with NOPARAMCOUNTCHECK for efficiency. A program to be called from a language other than COBOL must be compiled with NOPARAMCOUNTCHECK.

The RECURSECHECK directive turns on checking for recursion in generated code. NORECURSECHECK disables checking for recursion at execution time.

These compiler directives may be specified individually if that is desirable. It is important to note that if an application program created with these checks disabled contains logic errors the errors will not be detected by the runtime system. This can result in unrecoverable catastrophic failure and errors such as RTS 114 Attempt to access item beyond bounds of memory (Fatal) will occur.

Old KB# 14321