Thread: COBOL

WORKING-STORAGE vs FILE SECTION vs LINKAGE - simple explanation?

Started by Sam • user3 replies256 viewsLast activity 2 weeks ago
Post #1
0 votes
Sam
Reputation
5
Posts: 28
Joined: Jul 1, 2026, 2:30 PM
Posted: Jul 26, 2026, 12:48 PM

Three sections in DATA DIVISION and I keep putting stuff in the wrong one. Can someone explain like I just got here?

When does a record go in FILE SECTION instead of WORKING-STORAGE?

Post #2
1 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Jul 26, 2026, 1:48 PM

FILE SECTION = layout of records you READ/WRITE through an FD. Tied to a file.
WORKING-STORAGE = your work fields, flags, counters, report lines. Lives for the whole run.
LINKAGE SECTION = data passed in from a caller or from JCL PARM. You do not "own" the storage.

Post #3
0 votes
Tyler
Reputation
34
Posts: 19
Joined: Nov 8, 2025, 1:44 PM
Posted: Jul 26, 2026, 5:48 PM

I used to copy the FD layout into WS and READ INTO it. That is fine and sometimes clearer as a beginner.

You must be signed in to reply to this thread