Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
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 file 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 file 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++ 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
cobol test1.cbl
compiles the source file test1.cbl and binds the object file into a program file a.out.
2. The command
cobol -c test1.cbl
compiles the source file test1.cbl into an object file test1.o.
3. The command
cobol -g -o test2 x.cbl y.cbl z.cbl
compiles source files x.cbl, y.cbl, and z.cbl and binds the object files into a
program file 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 files x1.cbl and x3.cbl and binds the object files together with x2.o
into program file test3. Static binding has been specified, so the Binder tries to resolve
references using the library mylib.a before using the standard library libc.a. The -O 2
flag causes optimization during compilation and invocation of the Accelerator on the
program file.
5. The command
cobol -o xyz -Wbind="set heap 64" -Wsql x.o y.o z.o
binds the object files x.o, y.o, and z.o into a program file 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 file xyz without going through the
binding process.
527188-003 Hewlett-Packard Company 2−57