Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


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.

related tasks
Working with elements that have run-unit scope
Working with elements that have program invocation instance scope

related references
Scope of COBOL language elements with multithreading


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)