Created On:  10 October 2010

Problem:

When a program passes items to a sub-program via the LINKAGE SECTION the sub-program is directly affecting the memory location of the previous program.  If the space that has been declared in the linkage section is more in the sub-program than in the main program then there is potential for bad memory corruption in your program.  (It is allowed to pass a linkage section that is larger than the sub-program because this will not cause any memory errors.)

If the program writes to these "extra" bytes they will be entered into memory that could be anywhere in the run stack causing memory corruption.  Instead the runtime displays this error message advising  that there is a size mismatch. 

In general, the runtime displays the error message "Passed USING item (#1) smaller than corresponding LINKAGE item" to indicate that there is a potential problem in the program.

Resolution:

There is a configuration variable called CHECK_USING, the default value of this variable is "1" (on, true, yes), which causes that the runtime system tests each use of a LINKAGE data item to make sure that the item passed by the calling program is at least as large as the item declared by the called program. This ensures that unallocated memory is not accidentally referenced.

Setting this value to "0" (off, false, no) inhibits the parameters size matching test. It also inhibits the runtime test that verifies that all parameters of a subprogram are passed by the caller.

If this variable is set to "0", is very important to test the programs carefully to avoid corrupting memory.
Incident #2444064