Compiling from the Command Line

Before compiling, if the source code 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 Windows locale has been set correctly, to match the source encoding of these characters; this means setting the system locale in the 'Region and Language' section of Control Panel.

You control the way your program is compiled by specifying Compiler directives. For example, you use a Compiler directive to specify that you want the Compiler to produce a file in generated code format. You can also direct the Compiler to produce a source code listing file and an object code listing file.

You can compile (without linking) using the cobol command, and compile and link your program in one step using the cbllink utility.

You can also instruct the Compiler to automatically invoke the Linker to create an executable file.

You can either specify all the information required on the command line, or use the Compiler prompts.

When compiling native code, the Micro Focus COBOL Compiler compiles a program in two phases: