COBOL Manual for TNS/E Programs (H06.03+)
Data Division
HP COBOL Manual for TNS/E Programs—520347-003
7-39
CALL Statement and USING Phrase
•
Extended Addressing and the CALL Statement
If a formal parameter (in the called program) has EXTENDED-STORAGE access
mode (the default), a CALL statement (in the calling program) can pass it any
actual parameter defined in the calling program’s Data Division.
•
Access Mode Heritability
Subordinate items inherit the access mode of their parent. If a record has no
ACCESS MODE clause or has an ACCESS MODE EXTENDED-STORAGE
clause, no element of that record can have STANDARD access mode. If a record
has an ACCESS MODE STANDARD clause in its description, no element of that
record can have EXTENDED-STORAGE access mode.
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.
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.










