CUCO study materials
CUCO study resources

CUCO: Fundamentals of COBOL Programming

CUCO · Work through your exam, one topic at a time.

All guide sections

Fundamentals of COBOL Programming

The Fundamentals domain tests whether you can read the skeleton of a COBOL program and spot what will fail before execution: division order, source-format columns, naming, and sentence structure. Exam items typically show a short source fragment and ask which line is illegal or which division owns a clause.

The four divisions

A COBOL source program is a sequence of divisions in fixed order: IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE. IDENTIFICATION and PROCEDURE are mandatory; ENVIRONMENT and DATA may be omitted in a minimal program but are present in any real one. PROGRAM-ID is the only mandatory paragraph in IDENTIFICATION and names the program for CALL and for the load module.

  • ENVIRONMENT DIVISION holds CONFIGURATION SECTION (SOURCE-COMPUTER, OBJECT-COMPUTER, SPECIAL-NAMES) and INPUT-OUTPUT SECTION (FILE-CONTROL, I-O-CONTROL).
  • DATA DIVISION holds FILE, WORKING-STORAGE, LOCAL-STORAGE, LINKAGE and REPORT sections.
  • PROCEDURE DIVISION holds paragraphs, sections and statements; it begins with an optional USING clause for subprograms.

Source format

Traditional fixed format reserves columns 1–6 for sequence numbers, column 7 for the indicator (asterisk comments, slash page eject, hyphen continuation, D debugging line), columns 8–11 (Area A) for division headers, section headers, paragraph names and level 01/77 entries, and columns 12–72 (Area B) for statements and other levels. Free format removes these rules and uses *> for comments. COBOL is case-insensitive; user-defined names may contain letters, digits and hyphens, must contain at least one letter, and cannot be reserved words.

Sentences and scope

A sentence ends with a period. A statement may end with a scope terminator such as END-IF or END-PERFORM. The period still terminates every open construct, which is why an accidental period inside an IF can silently close it.

Worked example. A fragment shows MOVE WS-A TO WS-B starting in column 9 under a paragraph. It is illegal: column 9 is Area A, and MOVE is a statement, which belongs in Area B (columns 12–72). Moving the line right by three columns, or compiling in free format, fixes it. The reasoning is purely structural; the statement itself is valid.

Traps

  • Putting a paragraph name or 01 level in Area B, or a statement in Area A.
  • Using a reserved word such as DATE or STATUS as a data name.
  • Forgetting END PROGRAM when a source member contains several programs.
  • Assuming a period is optional after the last statement of a paragraph.
  • Treating lower case as different from upper case.