Exercise 2: Why DATA DIVISION and PROCEDURE DIVISION Aren't "Two Halves of the Same Thing" — Possible Solution ==================================================================== The colleague's framing treats the two divisions as interchangeable pieces of a single whole, but this chapter's own real material - and its own worked example - shows they serve two genuinely distinct, separate purposes rather than being two halves of one job. WHAT THE DATA DIVISION ACTUALLY DOES This chapter describes the DATA DIVISION as where "every piece of data a program works with gets described." In this chapter's own worked example, WS-GREETING is declared here, in the WORKING-STORAGE SECTION, specifying its own real shape (a PIC X(20) field with an initial value). Nothing in this division actually happens - it's pure declaration, establishing what data exists and what form it takes, with no execution involved at all. WHAT THE PROCEDURE DIVISION ACTUALLY DOES This chapter describes the PROCEDURE DIVISION as "where the real, executable logic lives." In the same worked example, DISPLAY WS-GREETING. is the actual instruction that does something - it references the already-declared data item by name and tells the program to display it. Nothing here declares what data looks like; it only acts on data that has already been described elsewhere. WHY THIS IS A REAL, MEANINGFUL SEPARATION, NOT A COINCIDENCE This chapter traces this exact separation directly back to Chapter 1's own material - the division between describing data and writing instructions was one of FLOW-MATIC's own real, documented contributions to COBOL's design. This wasn't an incidental byproduct of how COBOL happened to be organized; it was a deliberate, real design decision inherited from one of the two languages that directly influenced COBOL. WHY THIS MATTERS IN PRACTICE Because of this separation, a data item's own name, shape, and initial value need only be declared once, in the DATA DIVISION, and can then be referenced by that same name throughout the PROCEDURE DIVISION as many times as needed - exactly what this chapter's own worked example shows with WS-GREETING being declared once and then simply referenced by name. ANSWER: The DATA DIVISION and PROCEDURE DIVISION are not two halves of the same thing because they serve two genuinely separate jobs: the DATA DIVISION purely describes what data exists and its shape, with no execution at all, while the PROCEDURE DIVISION contains the actual executable instructions that act on that already-described data. This chapter's own worked example shows this directly - WS-GREETING is declared once in WORKING-STORAGE, then simply referenced by name in PROCEDURE DIVISION - and traces this exact separation back to one of FLOW-MATIC's own real, deliberate contributions to COBOL's design, covered in Chapter 1. WHY THIS WORKS AS AN ANSWER ------------------------------ This identifies the specific, distinct real job each division performs (declaration vs. execution), grounds the explanation in the chapter's own worked example, and connects the separation back to its real, documented historical origin rather than treating it as an arbitrary organizational choice.