cob (cob32 or cob64) Command

To invoke the Cob utility, enter the following from a UNIX system command prompt:

cob-command [options|filename] ...

Where:

cob-command
The version of the Cob utility to run, which can be:
cob
Executes the 32-bit or 64-bit version of the Cob utility depending on your effective working mode.

Your effective working mode is determined by the COBMODE environment variable, global settings or, if none of these is set, the default (64-bit). To show the effective working mode, enter cobmode at the command line without any arguments.

cob32
Executes the 32-bit version of the Cob utility.
cob64
Executes the 64-bit version of the Cob utility.
options
Either one cob option or a group of cob options comprising one or more cob flags.
filename
The name of an input file. These files can be any mixture of COBOL source code (.cbl, .CBL, .cob, or .COB), intermediate code (.int), linkable object code (.o or .so), C source (.c), C++ source (.C), Assembler source (.s), or archive (.a) files.

The cob command assumes that any unrecognized options are either input files or valid linker options to be saved and used at link time. In this way, any archive files you supply to the cob command are passed to the linker, which pulls out only the referenced files from the archive.

Example

cob -xve "" -o my_rts -C xopen prog.cbl prog2.c

The above command passes the XOPEN directive to the Compiler and instructs cob to compile the COBOL source file prog.cbl and the C source file prog2.c and to link the result into a system executable file named my_rts that, when run, expects the name of the program to run to be given on its own command line. The cob utility also gives verbose notification of its progress.

The above command assumes that neither the file $COBDIR/etc/cobopt nor the COBOPT environment variable exist.