Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

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, rst 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 le made up of COBOL85 modules cobol1.cbl and
cobol2.cbl and C modules c1.c and c2.c, you can rst 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 le 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 le 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++ Programmers Guide and the Open System Services Programmers Guide for
details on writing and compiling C programs in the OSS environment.
EXAMPLES
1. The command
ecobol test1.cbl
compiles the source le test1.cbl and links the object le into a program le a.out.
2. The command
ecobol -c test1.cbl
compiles the source le test1.cbl into an object le test1.o.
3. The command
ecobol -g -o test2 x.cbl y.cbl z.cbl
compiles source les x.cbl, y.cbl, and z.cbl and links the object les into a program le
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 les x.o, y.o, and z.o into a program le 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 le xyz without going
through the linking process. In addition to the input lename xyz, the catalog option is
passed to the NonStop SQL/MP compiler.
527188-003 Hewlett-Packard Company 339