COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-25
CALL
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 Binder (for a TNS program) or the nld or ld utility (for
a native program) 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 Binder (for a TNS program) or the nld or
ld utility (for a native program) 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 are building a PIC loadfile, and you want rld to run your program with
unresolved externals, you must link your program with either of these ld
options:
-set rld_unresolved IGNORE
-set rld_unresolved WARN
Two COBOL Programs With the Same Name
Two or more COBOL programs in a run unit can have the same program name. If
this happens, the compilation distinguishes between them according to these
scope rules:
°
If program A lacks the COMMON attribute and is directly contained in program
B, then only CALL statements in B can call A.
°
If program A has the COMMON attribute and is directly contained in program
B, then only CALL statements in B and CALL statements in other programs
contained in B (except for A and those contained in A) can call A.