LINKAGE SECTION
The part of a COBOL program's DATA DIVISION that describes data passed in from outside, such as from a calling program.
Also written PROCEDURE DIVISION USING, USING, PARM
The LINKAGE SECTION describes data that belongs to someone else. It sits in the DATA DIVISION, after WORKING-STORAGE, and it describes fields that the program receives rather than owns.
The data can come from a program that calls this one with CALL USING, from the PARM parameter on the EXEC statement in JCL, or in CICS, from the COMMAREA. The PROCEDURE DIVISION USING phrase lists which LINKAGE SECTION items match what is passed in.
LINKAGE SECTION items have no storage of their own. They are laid over the caller's memory. So when the called program changes one, it changes the caller's data directly. That is how a subprogram sends results back.
A PARM from JCL arrives as a two-byte binary length followed by the text, so the first item must describe that length. The layouts on both sides must match exactly, which is why a shared copybook is normally used for both.
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
- CALLThe COBOL statement that runs another program and passes data to it, then continues when that program returns.
- DATA DIVISIONThe part of a COBOL program that declares every record layout and variable it will use.
- WORKING-STORAGEThe section of a COBOL program that declares its internal variables: counters, totals, flags and work areas.
- COMMAREAThe communication area: a block of data a CICS program passes to another program, or keeps for the next step of a conversation.
- CopybookA shared block of COBOL declarations kept in a library and included into programs, so a record layout is defined once.