COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
CALL Statement and USING Phrase
The Linkage Section is required when parameters are passed from a calling program to a called
program, which is signaled by the presence of a USING phrase in the Procedure Division header
of the called program.
The data items named in the CALL statement of the calling program correspond with the data items
named in the USING phrase of the Procedure Division header of the called program. For details,
see CALL (page 293).
Statements within the Procedure Division of the called program can refer to any items defined in
the Linkage Section of the program. Global items can be referenced by contained programs. The
Linkage Section can contain matched and unmatched items. Matched items are those within a
record that is specified in the USING phrase of the Procedure Division header, within a record
that is a redefinition of a matched record, a level-77 item or a record that is in the USING phrase,
or a redefinition of those. An unmatched item is one not associated with the USING phrase.
The PORT directive determines the action taken for a reference to an unmatched item. If the program
was not compiled with the PORT directive, the compiler issues a warning for any unmatched record
or level-77 item. A reference to an unmatched item can cause abnormal program termination,
data corruption, or other failures. If the program was compiled with the PORT directive, the SET
ADDRESS OF statement can make unmatched items accessible. A reference to an unmatched item
for which no address was set can cause abnormal program termination, data corruption, or other
failures.
A BASED item must be an unmatched item. No warning is issued for an unmatched BASED item,
regardless of the PORT directive.
Linkage Section 181










