COBOL
The language most of the bank's business programs are written in. It reads like plain English.
Also written Common Business-Oriented Language
Why it matters. The programs that post payments and work out interest are mostly COBOL. At work you read it and fix it.
See it
Every COBOL program starts with this division. It names the program.
Syntax
DISPLAY item-1 [item-2 ...] [UPON mnemonic-name] [WITH NO ADVANCING]
- item
- A literal in quotes, or a data name. Several items print side by side.
- UPON
- Send the text to a named device. SYSOUT is the usual one.
- WITH NO ADVANCING
- Don't start a new line afterwards.
Try it RUNCOBOL
- 1
You're in the program WELCOME. Everything else is written. It needs one line that shows the message WELCOME TO ZEDBANK on the screen.
COBOL DISPLAY 'WELCOME TO ZEDBANK' - 2
Run the program WELCOME from your DEV COBOL library.
RUNCOBOL 'ZB0001.DEV.COBOL(WELCOME)'
Remember
- COBOL is written in four parts, called divisions.
- DISPLAY shows text. The text goes in quotes.
- RUNCOBOL is a shortcut. On z/OS you compile, link-edit and run COBOL as a job.
The usual mistake
DISPLAY WELCOME TO ZEDBANK
With no quotes, COBOL looks for fields called WELCOME, TO and ZEDBANK. They do not exist, so the program does not run.
DISPLAY 'WELCOME TO ZEDBANK'
On real z/OS
MF/OS reads and runs COBOL source directly with its own interpreter. Real z/OS compiles it with Enterprise COBOL (program IGYCRCTL), link-edits it, and runs the load module under Language Environment. Messages from the MF/OS checker start with MFSIM, not IGY.
Where can I practise COBOL?
Right here, at ZedBank. You take a junior job at a simulated bank and use COBOL in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- COBOL divisionsThe four fixed sections every COBOL program is built from, always in the same order.
- PICTURE clauseThe COBOL declaration that says what kind of data a field holds and how long it is, written as PIC.
- CopybookA shared block of COBOL declarations kept in a library and included into programs, so a record layout is defined once.
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.
- Legacy systemAn older system still doing essential work. On the mainframe, usually code that has been correct and running for decades.
- Mainframe application developerThe person who writes and changes the business programs: COBOL, JCL, SQL and the logic that runs the organisation.