Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

cobol(1) OSS Shell and Utilities Reference Manual
DESCRIPTION
The cobol utility is the interface to the COBOL85 compilation system; it accepts source code
conforming to the ISO COBOL85 standard. The system conceptually consists of a COBOL85
compiler and Binder, with additional program components supporting NonStop SQL/MP compi-
lation (sqlcomp), and object code acceleration (axcel). The les specied in the operand list are
operated on by the appropriate program components of the compilation system, depending on the
command line ags and the type of le operands.
If the -c ag is specied, for all pathname operands of the form le.cbl, the les $(basename
pathname.c).o are created as the result of successful compilation.
If -c is not specied, the object les created after successful compilation are combined into a pro-
gram le by the bind operation. Object les created are not deleted after successful generation of
the executable program le.
If no ags are present to prevent program binding (such as -c or -Wnobind, and if all le
operands compile and link without error, the resulting executable le is written according to the
-o outle ag (if present) or to the le a.out.
The executable le is created according to OSS le creation rules, except that the le permis-
sions are set to S_IRWXO | S_IRWXG | S_IRWXU and the bits specied by the umask of the
process are cleared.
HP Extensions
The -W ags are HP-specic ags supporting the HP compilation environment. The argument
strings following these ags are passed to the program components unchanged, along with
default argument strings and argument strings corresponding to cobol command line ags mean-
ingful to the program components. Do not specify conicting instructions in -W ag argument
strings or cobol command line ags. The results of conicting instructions are undened.
Operands
An operand is either a pathname or in the form -l library. At least one operand of the pathname
form must be specied. The following operands are supported:
file.cbl A COBOL85 language source le to be compiled and optionally linked.
file.cob A COBOL85 language source le to be compiled and optionally linked.
file.a A library of object les typically produced by the ar command, and passed directly to
the Binder.
file.o An object le produced by the command cobol -c and passed directly to the Binder.
file.so A shared runtime library produced by the Binder. The shared runtime library is used
by the Binder to resolve external references.
-l library In the static binding mode, search for the library named liblibrary.a. In the dynamic
binding mode, search for the library named liblibrary.so. If liblibrary.so is not found,
liblibrary.a is used.
A library is searched when its name is encountered, so the placement of -l is
signicant.
Input Files
Input les are one of the following:
A text le containing a COBOL85 language source program
256 Hewlett-Packard Company 527188-007