COBOL Manual for TNS and TNS/R Programs
Data Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
7-53
GLOBAL Clause
Within a run unit, if two or more programs describe the same external data record,
then the associated data description entries (including all subordinate data-names
and data items and their redefinitions) must be identical; however, a program that
describes an external record can contain a data description entry including the
REDEFINES clause that redefines the complete external record, and this complete
redefinition need not occur identically in other programs in the run unit. Also, all
descriptions must be in the same section; that is, a description cannot be in the
Extended-Storage Section in one program and in the Working-Storage Section of
another program.
When a file description entry contains the EXTERNAL clause, the data items
defined in its associated record description entries inherit the external attribute;
therefore, the preceding rules apply to these record description entries as well as
those defined in the Working-Storage Section and Extended-Storage Section.
Example 2-2 contains an example of the use of the EXTERNAL clause.
GLOBAL Clause
The GLOBAL clause specifies that a data-name is a global name. A global name is
available to every program contained within the program that describes it, even though
the contained programs do not contain a description of it.
Usage Considerations:
•
Global Name Can be Used in Contained Programs
A statement in a program contained directly or indirectly within a program that
describes a global name can reference that name without describing it again.
•
Only for Level-01 Items
The GLOBAL clause can be specified only in data description entries whose level
number is 01 in the File Section, Working-Storage Section, or Extended-Storage
Section.
•
Name Uniqueness Within a Single Program
In the Data Division of any one program, the data description entries for any two
data items for which the same data-name is specified must not include the
GLOBAL clause.
GLOBAL
IS
VST076.vsd