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 files specified in the operand list are
operated on by the appropriate program components of the compilation system, depending on the
command line flags and the type of file operands.
If the -c flag is specified, for all pathname operands of the form file.cbl, the files $(basename
pathname.c).o are created as the result of successful compilation.
If -c is not specified, the object files created after successful compilation are combined into a pro-
gram file by the bind operation. Object files created are not deleted after successful generation of
the executable program file.
If no flags are present to prevent program binding (such as -c or -Wnobind, and if all file
operands compile and link without error, the resulting executable file is written according to the
-o outfile flag (if present) or to the file a.out.
The executable file is created according to OSS file creation rules, except that the file permis-
sions are set to S_IRWXO | S_IRWXG | S_IRWXU and the bits specified by the umask of the
process are cleared.
HP Extensions
The -W flags are HP-specific flags supporting the HP compilation environment. The argument
strings following these flags are passed to the program components unchanged, along with
default argument strings and argument strings corresponding to cobol command line flags mean-
ingful to the program components. Do not specify conflicting instructions in -W flag argument
strings or cobol command line flags. The results of conflicting instructions are undefined.
Operands
An operand is either a pathname or in the form -l library. At least one operand of the pathname
form must be specified. The following operands are supported:
file.cbl A COBOL85 language source file to be compiled and optionally linked.
file.cob A COBOL85 language source file to be compiled and optionally linked.
file.a A library of object files typically produced by the ar command, and passed directly to
the Binder.
file.o An object file 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
significant.
Input Files
Input files are one of the following:
• A text file containing a COBOL85 language source program
2−56 Hewlett-Packard Company 527188-007