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.
Related terms
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- Link-editCombining compiled object code with the other modules it needs into a single runnable program.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- PROCA reusable piece of JCL stored as a member and invoked by name, so common steps are written once.
- Return codeA number a program leaves behind saying how it went. Zero for clean, higher numbers for warnings and failures.
- CopybookA shared block of COBOL declarations kept in a library and included into programs, so a record layout is defined once.