COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
continues according to the rules for that statement. Unless that statement transfers control
elsewhere, control passes from that statement to the end of the CALL statement.
If the object form of the called program is not included in the run unit, the action of the CALL
statement depends on the presence or absence of an EXCEPTION phrase (on-phrase or
historical-on-phrase ). If an EXCEPTION phrase is specified, control passes to
excp-imperative-statement. If an EXCEPTION phrase is not specified, the run unit
terminates abnormally with a failure message.
• Determining Which Program a CALL program-name Statement Calls
The steps for determining which program the CALL statement calls follow.
1. The value of program-name—the program name—is stripped of leading and trailing
spaces and is converted to uppercase. (All COBOL program names are converted to
uppercase for the purpose of matching.)
2. If the program name from Step 1 is that of a COBOL program that was compiled in this
compilation unit, then that program is the called program.
3. If the program name from Step 1 is not that of a program that was compiled in this
compilation unit, then the program searches for a program by that name in these places,
in this order:
a. The file associated with file-mnemonic (if file-mnemonic is specified)
b. The files on the primary search list (established by the SEARCH directive)
c. The files on the tertiary search list (established by the CONSULT directive)
d. For a TNS program, the TNS user library (established by the LIBRARY directive)
e. The files associated with SEARCH DEFINEs
4. If the program name from Step 1 is that of a program in one of the preceding files, that
program is the called program.
5. The program name from Step 1 is restored to its original case.
6. Step 3 is repeated.
7. The program name from Step 4 is converted back to uppercase and compilation continues.
When compilation ends (at the end of the source file), if a COBOL program with the
desired name has been compiled, then it is the called program.
8. If no program is found using the above steps, then the calling program looks for a VALUE
phrase. If the VALUE phrase is absent, the calling program assumes that the CALL statement
is a COBOL CALL statement. It passes the uppercase name to the eld utility and passes
all parameters by reference as extended addresses.
9. If the VALUE phrase is present, the calling program assumes that the CALL statement is
an X/Open CALL statement. It passes the name as it was specified in program-name
to the eld utility and passes all parameters as extended addresses—the VALUE parameters
by value and all others by reference.
10. If you are calling a program written in a language other than COBOL, and it has no
VALUE parameters, you must make the program stub of the called program available to
the compiler using one of the files listed in Step 3.
11. If the program that program-name specifies is not available at execution time, an
exception exists.
12. If you want rld to run your program with unresolved externals, you must link your program
with either of these eld options:
◦ -set rld_unresolved IGNORE
◦ -set rld_unresolved WARN
CALL 297










