COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-40
CALL Statement and USING Phrase
EXTENDED-STORAGE
specifies extended (32-bit) addressing. This is the default.
STANDARD
specifies standard (16-bit) addressing.
STANDARD cannot be specified for a program that is to be called with a CALL
identifier statement. The compiler cannot check for this, so the result of such
a call is undefined.
Usage Considerations:
STANDARD Access Mode and the CALL Statement
If a formal parameter (in the called program) has STANDARD access mode, the
CALL statement (in the calling program) cannot pass it an actual parameter that
has EXTENDED-STORAGE access mode (the default) and was declared in the
calling program’s Extended-Storage Section or Linkage Section. Also, the called
program’s object must be available to the compiler when the calling program is
compiled (see CALL).
The only advantage to STANDARD is slightly more efficient access in the called
program.
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.
Note. If you specify STANDARD in a TNS/R program, the NMCOBOL compiler issues a
warning and uses 32-bit addressing.