Area A and Area B
The fixed column layout of a COBOL source line, which decides where each part of the code must start.
Also written COBOL columns, column 7, indicator area, sequence area
Traditional COBOL source has a fixed layout, based on 80-column punched cards. Where something starts on the line matters.
Columns 1 to 6 are the sequence area, once used for card numbers and now usually blank or ignored. Column 7 is the indicator area: an asterisk there makes the line a comment, a hyphen continues the previous line, and a D marks a debugging line. Columns 8 to 11 are Area A. Division, section and paragraph names, FD entries and 01 and 77 level numbers start there. Columns 12 to 72 are Area B, where the statements and the rest of the data descriptions go. Columns 73 to 80 are ignored by the compiler.
The most dangerous rule is the last one. Anything past column 72 is ignored, so a statement that runs too far is quietly cut short. That can change a program's logic without any error.
The ISPF editor's COLS line command shows a ruler, and many sites set up the editor to mark the columns for COBOL. Most mistakes with columns show up as compile errors, so read compile messages that mention Area A or Area B carefully.
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
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- COBOL divisionsThe four fixed sections every COBOL program is built from, always in the same order.
- ParagraphA named block of statements in the PROCEDURE DIVISION, the unit that PERFORM runs.
- Level numberThe two-digit number in front of a COBOL data item that shows how fields nest inside a record.
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.