Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
User Commands (d - f) ecobol(1)
Refer to the eld(1) reference page for more information.
Using the c89 and ecobol Utilities
OSS COBOL85 programs can contain COBOL85 modules and C modules. Compile COBOL85
modules using the ecobol utility and C modules using the c89 utility. To produce a program con-
taining COBOL85 and C modules, first compile all the modules written in either COBOL85 or C.
You can also link these modules together or with other libraries at this time, but do not SQL-
compile the modules. After you have compiled all the modules of one language, compile the
modules written in the other language, specifying any necessary linking or SQL-compiling
options.
For example, to produce an executable object file made up of COBOL85 modules cobol1.cbl and
cobol2.cbl and C modules c1.c and c2.c, you can first run the C compiler using the c89 utility
with:
c89 -c -o cprog.o c1.c c2.c
This command directs c89 to compile the two modules but not link them. The output object file is
cprog.o.
You can then invoke the ecobol utility to compile the two COBOL85 modules and link the
ECOBOL compiler output with the previously produced C object file and the standard C library to
produce the executable object myprog with:
ecobol -o myprog cprog.o cobol1.cbl cobol2.cbl
Refer to the C/C++ Programmer’s Guide and the Open System Services Programmer’s Guide for
details on writing and compiling C programs in the OSS environment.
EXAMPLES
1. The command
ecobol test1.cbl
compiles the source file test1.cbl and links the object file into a program file a.out.
2. The command
ecobol -c test1.cbl
compiles the source file test1.cbl into an object file test1.o.
3. The command
ecobol -g -o test2 x.cbl y.cbl z.cbl
compiles source files x.cbl, y.cbl, and z.cbl and links the object files into a program file
test2. Symbolic information is generated by the compiler and retained by the linker utility
for debugging.
4. The command
ecobol -o xyz -Wsqlmx x.o y.o z.o
links the object files x.o, y.o, and z.o into a program file xyz. The NonStop SQL/MX com-
piler is then invoked to compile xyz.
5. The command
ecobol -Wnolink -Wsql="catalog \$abc.def" xyz
invokes the NonStop SQL/MP compiler, sqlcomp, on program file xyz without going
through the linking process. In addition to the input filename xyz, the catalog option is
passed to the NonStop SQL/MP compiler.
527188-004 Hewlett-Packard Company 3−39