Sharing data in nested programs

Some applications consist of nested programs, that is, programs that are contained in other programs. Level-01 data items can include the GLOBAL clause. The GLOBAL clause specifies that a data-name is available to every program contained within the program that defines it, as long as the contained program does not itself have a definition for that name.

About this task

A nested program cannot access data items in a sibling program (one at the same nesting level in the same containing program), but they can both refer to data items defined with the EXTERNAL clause or data items in the containing program if they are defined with the GLOBAL clause.

Related concepts  
Nested programs