Java Reference
In-Depth Information
Figure 4.1 shows how LINKAGE SECTION items are available to both caller
and subroutine, whereas WORKING-STORAGE items in the subroutine are pri-
vate to the subroutine.
FIGURE 4.1
A subroutine has both LINKAGE AREA and WORKING-STORAGE.
In this way, the subroutine specification defines what is available to external
programs and what is private to the subroutine. At the same time, the subroutine
is free to define any internal items, based on its own requirements. The calling pro-
gram is not aware of these details.
MYSUB COBOL
In this subroutine, CALL-COUNTER is a private variable and cannot be directly ac-
cessed by a caller. As a result, the number of times MYSUB has been called is not
discovered by calling programs.
PROGRAM-ID. MYSUB.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CALL-COUNTER PIC S9(17) COMP-3 VALUE 0.
LINKAGE SECTION.
01 MYSUB-CONTROL.
Search WWH ::




Custom Search