Skip to main content

Problem:

If you have program_search_order set to 2 which should do the following when looking for submodules

2 Uses the following search sequence:

   (1)The run-time system is checked to see if the program is loaded or statically linked. If it is. the search ends.

   (2)The path in which the calling program was loaded is searched.

   (3) If the COBPATH environment variable is set, the paths specified are searched in order. Otherwise, the current directory is searched. (You should not modify the COBPATH environment variable as it is used by this COBOL system.)

   (4) If the COBDIR environment variable is set, the paths specified are searched in order.

But my tracing shows it is alwasy looking in current directory before anywhere else.

Resolution:

If you call a submodule with an extension it is considered a fully qualified path name and nullifies the search order parameter value. So if you want to use runtime tuneable program_search_order, omit an extension in your call statement.

From Net Express on-line docs on program_search_order

Note: If a program is called with a specific path the search sequence is not affected by the value of program_search_order and instead:

   1. The run-time system is checked to see if the program is loaded or statically linked.

   2. The path specified in the call is searched.

Old KB# 3807