COBOL Manual for TNS and TNS/R Programs
Using HP COBOL in the OSS Environment
HP COBOL Manual for TNS and TNS/R Programs—522555-006
19-5
Mixed-Language Programs
Mixed-Language Programs
In the OSS environment, you can write mixed-language programs.
Topics:
•
TNS Programs
•
Native Programs
TNS Programs
A TNS HP COBOL program can call programs written in TNS HP COBOL, TNS HP C,
TNS HP C++, or TAL, but not programs written in FORTRAN or Pascal.
To produce a TNS HP COBOL program that contains TNS HP COBOL and TNS HP C
modules, follow these steps:
1. Using the /usr/nonnative/c89 utility, compile the HP C modules, but do not
bind them.
2. Using the cobol utility, compile the HP COBOL modules, specifying any
necessary binding, accelerating, or SQL-compiling flags.
For example, suppose that you want to produce a loadfile from the HP COBOL
modules cobol1.cbl and cobol2.cbl and the HP C modules c1.c and c2.c.
First you use the c89 utility to compile the HP C modules without binding them:
c89 -c -o cprog.o c1.c c2.c
The resulting object file is cprog.o.
Then you use the cobol utility to do this:
•
Compile the HP COBOL modules
•
Bind the COBOL85 compiler output, the object file cprog.o, and the standard
HP C library
•
Run the Accelerator and produce the loadfile myprog:
cobol -o myprog cprog.o cobol1.cbl cobol2.cbl