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

User Commands (c) cobol(1)
utility with:
c89 -c -o cprog.o c1.c c2.c
This directs c89 to compile the two modules but not to bind them. The output object le is
cprog.o.
You can then invoke the cobol utility to compile the two COBOL85 modules, bind the
COBOL85 compiler output with the previously produced C object le and the standard C library,
and run the Accelerator to produce the executable object myprog with:
cobol -o myprog -O 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
cobol test1.cbl
compiles the source le test1.cbl and binds the object le into a program le a.out.
2. The command
cobol -c test1.cbl
compiles the source le test1.cbl into an object le test1.o.
3. The command
cobol -g -o test2 x.cbl y.cbl z.cbl
compiles source les x.cbl, y.cbl, and z.cbl and binds the object les into a
program le test2. Symbolic information is generated by the compiler and retained by
the Binder for debugging.
4. The command
cobol -o test3 -O 2 -WBstatic x1.cbl x2.o x3.cbl -l mylib
compiles source les x1.cbl and x3.cbl and binds the object les together with x2.o
into program le test3. Static binding has been specied, so the Binder tries to resolve
references using the library mylib.a before using the standard library libc.a. The -O 2
ag causes optimization during compilation and invocation of the Accelerator on the
program le.
5. The command
cobol -o xyz -Wbind="set heap 64" -Wsql x.o y.o z.o
binds the object les x.o, y.o, and z.o into a program le xyz. The Binder sets the
heap size of the program to 64 pages. The NonStop SQL/MP compiler, sqlcomp, is then
invoked on xyz to compile xyz.
6. The command
cobol -Wnobind -Waxcel xyz
invokes the Accelerator, axcel, on object or program le xyz without going through the
binding process.
527188-003 Hewlett-Packard Company 257