The cob command enables you to produce executable files of the following types:
- Intermediate code
-
.int files are dynamically loadable, and don't need to be linked into a system executable. Use the
cob -i flag to produce this type of file.
- Generated code
-
.gnt files are dynamically loadable, and don't need to be linked into a system executable. Use the
cob -u flag to produce this type of file.
- Callable shared object files
- These files are dynamically loadable, and don't need to be linked into a system executable. Use the
cob -y or
cob -z flags to produce this type of file.
- Shared library files
- These are system linkable files that can be linked into executable files. They cannot be directly executed themselves. Use the
cob -Y or
cob -Z flags to produce this type of file.
- System executable files
- These files are directly executable. They are loaded by the operating system, which creates a new process in which to run them. Use the
cob -x flag to produce this type of file.
- Java bytecode
- These files (.class files) contain the intermediate code that is executed by a compatible Java Virtual Machine (JVM). Use the COBOL/Java Application
Launcher (cobjrun) to launch such files. Use the
cob -j flag to produce this type of file.
The cob command provides the interface between your COBOL source program and the following COBOL system components:
- The Compiler - to syntax check and compile your COBOL source files into
intermediate (.int) code files, and to generate the .int files into generated (.gnt) or object (.o) code files
- The system linker - to link object code into a callable shared object, shared library or system executable file
It also provides an interface to the C++ compiler, cc (the C compiler) and as (the Assembler).
If the source code to be compiled contains characters beyond the standard 7-bit ASCII character set (for example, accented
characters or characters belonging to multi-byte character sets), you must ensure that the locale has been set correctly,
to match the source encoding of these characters. This means setting LANG, LC_CTYPE, or LC_ALL appropriately; each of these
variables takes precedence over the former.