Skip to content
COBOL

Compile

Turning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.

Also written compiler, COBOL compile

Compiling translates the COBOL you wrote into machine code the processor can run. On z/OS this happens as a batch job, usually by calling a site-supplied procedure rather than assembling the steps yourself.

The compiler reads your source from a library member, pulls in any copybooks it references, and produces two things: an object module containing the translated code, and a listing on SYSPRINT showing the source with any diagnostics attached.

That listing is where you spend your time when something is wrong. Messages are graded by severity, and the compiler returns a code reflecting the worst one found. Warnings still allow a successful compile; errors do not.

Compiling is only the first stage. The object module is not yet runnable. It has to be link-edited into a load module before anything can execute it. Most sites wrap compile, link and sometimes a test run into a single procedure, so one job does all of it and you look at the return code from each step to see how far it got.

Browse all 115 terms

Learn this properly.

Use Compile for real in Mainframe101, in your browser, with Zed beside you. Join the waitlist.

Early access and updates. No spam, unsubscribe any time.