Coding the LINKAGE SECTION
Code the same number of data-names in the identifier list of the called program as the number of arguments in the calling program. Synchronize by position, because the compiler passes the first argument from the calling program to the first identifier of the called program, and so on.
About this task
You will introduce errors if the number of data-names in the identifier list of a called program is greater than the number of arguments passed from the calling program. The compiler does not try to match arguments and parameters.
The following figure
shows a data item being passed from one program to another (implicitly BY
REFERENCE
):
In
the calling program, the code for parts (PARTCODE
)
and the part number (PARTNO
) are distinct data items.
In the called program, by contrast, the code for parts and the part
number are combined into one data item (PART-ID
).
In the called program, a reference to PART-ID
is
the only valid reference to these items.