The compiler deduces the contents of a file from its file name extension and performs the appropriate compilation actions. Hence the file name must have the extension which is appropriate to the file’s contents in accordance with POSIX conventions. The choices are:
Extension | Meaning |
.cob/.cbl | COBOL source file |
.o | Object file generated in an earlier compilation |
.a | Object file archive generated by the |
Files with a .cob or .cbl extension are the input sources for the COBOL2000 compiler. The COBOL2000 compiler also recognizes COBOL source files with names which do not have one of these standard extensions, but in this case the names of the source files must be specified with the -k
filename option (see section "General options"), and not as operands.
Files with a .o or .a extension are the input sources for the linkage editor.
File names with other extensions are passed through to the linkage editor cobld.