Compiler options
Settings that control how the COBOL compiler builds a program, which can change both its speed and its behaviour.
Also written CBL statement, PROCESS statement, SSRANGE, TRUNC, OPTIMIZE, ARCH, NUMPROC
The COBOL compiler has many options, and they matter more than people expect. Some only change the listing. Others change how the program behaves when it runs.
A few common ones: OPTIMIZE controls how much the compiler improves the generated code for speed. ARCH tells it which processor generation it can build for, so it can use newer instructions. SSRANGE adds checks that subscripts stay inside their tables. TEST adds information for debugging tools. TRUNC controls how binary fields are truncated when a value is larger than the PICTURE allows. NUMPROC controls how signs in numeric fields are handled. MAP and LIST add sections to the listing.
Sites set defaults for everyone, and a program can set its own with a CBL or PROCESS statement at the top of the source. Compile procedures for test and production often use different options, such as SSRANGE in test.
Because some options change results, a program can behave differently after being compiled with different options, even with no source change. When a program behaves differently in production than in test, compare the options in the two compile listings.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.
- Compile listingThe report a compiler produces: the source with line numbers, error messages, and maps that help find where a program failed.
- Binary fieldA COBOL number stored as a binary integer, written with USAGE COMP, COMP-4, BINARY or COMP-5.
- OCCURSThe COBOL clause that defines a table: a field repeated a set number of times, like an array in other languages.
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- Language EnvironmentThe common run-time support for COBOL, PL/I and C programs on z/OS, which handles storage, errors and messages while they run.