Working with language elements with multithreading

Because your COBOL programs can run as separate threads within a process, a language element can be interpreted in two different scopes: run-unit scope, or program invocation instance scope. These two types of scope are important in determining where an item can be referenced and how long the item persists in storage.

Run-unit scope
While the COBOL run unit runs, the language element persists and is available to other programs within the thread.
Program invocation instance scope
The language element persists only within a particular instance of a program invocation.

An item can be referenced from the scope in which it was declared or from its containing scope. For example, if a data item has run-unit scope, any instance of a program invocation in the run unit can reference the data item.

An item persists in storage only as long as the item in which it is declared persists. For example, if a data item has program invocation instance scope, it remains in storage only while that instance is running.