Previous Topic Next topic Print topic


Calling Programs According to How They Are Linked

When you call one COBOL program from another, you specify the name of the program to call either in a data-name or as a literal. For example:

CALL program-name USING ...  
CALL "program-name" USING ...  

where program-name (without quotation marks) is a data item that contains a valid program-name, and "program-name" (with quotation marks) is a literal string and is the actual name of a valid program.

The called program can be statically or dynamically linked, where a statically linked program is an .exe file and a dynamically linked module is a .dll file.

Calling Statically or Dynamically Linked Programs

Use a CALL literal statement to call a statically or dynamically linked program directly. If the program is not already in memory, the dynamic loader tries to find a dynamically loadable version of the program. If the program cannot be found, an RTS error message is issued.

For statically linked programs, calls using literal strings are converted to subroutine calls which refer to external symbols. A routine is automatically created to define the symbol and to load the associated file if it is entered when the program runs.

Calling Dynamically Loadable Programs

Use either a CALL literal statement, or a CALL data-name statement, to call a dynamically loadable program, and make the dynamic loader run-time support module search for the called program.

If the file is not found, the run-time system tries to load a .dll file from PATH using the specified base-name.

Previous Topic Next topic Print topic