When a program is called, the run-time system checks to see if the program has already been loaded or logically canceled. If the program is already available in memory, the run-time system passes control to it.
This search sequence only applies to called program files. It does not apply to other types of file, such as COBOL copybooks; use the COBCPY environment variable to locate copybooks.
At each stage of the search sequence, if the called program is named explicitly (name and extension specified), the specific file is searched for. If the called program is named implicitly, (base name only, no extension specified) the run-time system looks for executable files in the order:
If the search reaches the last directory without finding an executable file, the run-time system issues a "program not found" error message.
In the case of a library file (.lbr), the run-time system opens it, and searches it for an executable name filename.ext where .ext is one of the other executable file types listed above.
CALL "$MYLIB\A"the subprogram A is loaded from the path as defined by the MYLIB environment variable when the program is run.