FORTRAN Reference Manual
Mixed-Language Programming
FORTRAN Reference Manual—528615-001
13-4
Referencing Separately-Compiled Procedures
For further information about Binder groups, see the Binder Manual.
Referencing Separately-Compiled Procedures
Your FORTRAN program can call routines that are compiled in separate compilations,
including the ‘main’ procedure. For example, you might write your own FORTRAN
subroutine to provide the parameters to a standard application.
Your FORTRAN routines can access the separately-compiled code using:
•
The SEARCH directive to specify one or more disk-resident object files that contain
object code created by the C, COBOL85, FORTRAN, Pascal, or TAL compilers.
•
Binder to link program units written in different languages.
•
Program libraries that contain compiled program modules for use by any program.
See the SEARCH Compiler Directive on page 10-61. Section 9, Program Compilation,
includes an example of an independent compilation using the SEARCH directive.
Using Binder
You can enter Binder commands interactively or by placing the commands in a file that
Binder reads. Binder creates an object file that includes the code blocks and data
blocks you specify.
The following example shows an interactive Binder session in which code and data
blocks from the object files TALPROC (a TAL file), COBPROC (a COBOL85 file), and
FORTPROC (a FORTRAN file) are included in the object file TARGET (the @ is the
Binder prompt):
1> BIND
@ADD * FROM cobproc
@ADD * FROM talproc
@ADD * FROM fortproc
@BUILD target
The ADD * command adds all the code and data blocks from an object file to be
included in the object file created by Binder.
The BUILD command creates the new object file.
For additional information about Binder, see the Binder Manual.
Using Program Libraries
You can compile program modules and keep them in object module libraries for use by
any program. FORTRAN programs can invoke library routines, including those written
in languages other than FORTRAN.










