GLOBAL Data Items and Files [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation
HP COBOL II/XL Programmer's Guide
GLOBAL Data Items and Files
GLOBAL data items and files can be shared by two or more programs (or
subprograms). For programs to share a GLOBAL item:
* One program must declare the GLOBAL item (data item or file).
* The other programs must be nested within the program that declares
the GLOBAL item.
* A program nested within the program that declares the GLOBAL item
cannot have a local item with the same name and qualification as
the GLOBAL item. If it does, references to that name refer to the
local item rather than the GLOBAL item.
For more information, see Chapter 3 .
NOTE If a file is declared GLOBAL in one program, and is opened in
another program that uses the EXCLUSIVE statement, then the first
program must declare the file with L in the ASSIGN clause. This
enables dynamic locking.
Similarly, if a file is declared GLOBAL in a program that does not
write to it, it must declare it with CCTL in the ASSIGN clause to
enable CCTL.
MPE/iX 5.0 Documentation