Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
User Commands (c) cobol(1)
shared runtime libraries are used.
By default, the shared runtime library used during binding (the model library) is the shared run-
time library used during execution (the runtime library), unless a different library is specified by
the -Wrunlib flag.
The shared runtime library must be in the Guardian file system name space. If a shared runtime
library is in the OSS file system name space, you must supply a library in the Guardian name
space either using the -Wrunlib flag during program generation or through the LIB option of the
TACL RUN command during program execution.
Refer to the Binder Manual for more details on using shared runtime libraries.
Using the c89 and cobol Utilities
OSS COBOL85 programs can contain COBOL85 modules and C modules. Compile COBOL85
modules using the cobol 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 bind these modules together or with other libraries at this time, but do not
accelerate or 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 binding,
accelerating, 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 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.
527188-021 Hewlett-Packard Company 2−91