The EXTERNAL and GLOBAL clauses allow you to share data and files between different COBOL subprograms. EXTERNAL is used to access globally declared data, including data declared EXTERNAL by other COBOL programs. GLOBAL is only applicable when sharing data among nested programs in an ANSI85 dialect.
The EXTERNAL clause is used to designate data or a file outside the scope the current program unit. In order for the data or file to share access, you must declare it exactly the same in another program unit. You must put the keyword EXTERNAL on all declarations. Otherwise, those lacking EXTERNAL will be considered regular data and you will not be accessing shared data or files. To ensure that you define EXTERNAL data consistently, define them in a copy file and use the COBOL COPY verb to copy them into the modules that need access to them.
Declarations having the EXTERNAL clause cannot have VALUE clauses. The exception is the 88 level items. The 88 level items can have VALUE clauses associated with them. Using EXTERNAL on a group item makes the group item and all those items subordinate to it externally visible.
Note that INDEX data of a table that are defined as EXTERNAL are not shared. You can override this restriction by using the compiler directive EXTINDEX.
Example of External CopyBook. There the data is present in all the
comunicating programms, which have included the Book.
No Fields in Linkage needed for programm-comunication.