ILE COBOL Programmer's Guide


How Language Elements Are Interpreted in a Multithreaded Environment

Because your ILE COBOL programs can be run as separate threads within a job, be aware that language elements might be interpreted in two ways:

Run-unit scope
The language element persists for the duration of the ILE COBOL run-unit execution and is available to other programs within the thread.

Program invocation instance scope
The language element persists only within a particular program invocation instance.

These two types of scope are important in two contexts:

Reference
Describes where an item can be referenced from. For example, if a data item has run-unit reference scope, any program invocation instance in the run unit can reference the data item.

State
Describes how long an item persists in storage. For example, if a data item has program invocation instance state scope, it will remain in storage only while the program invocation instance is running.

The following table summarizes the reference and state scope of various ILE COBOL language elements:

Language Element Reference Scope State Scope
ADDRESS-OF special register Same as associated record Program invocation instance
DB-FORMAT-NAME special register Run-unit Program invocation instance
DEBUG-ITEM special register Syntax checked only
Files Run-unit Run-unit
FORMAT OF special register Same as associated identifier Same as associated identifier
Index data Program Program invocation instance
LENGTH OF special register Same as associated identifier Same as associated identifier
LINAGE-COUNTER special register Same as associated file Same as associated file
LINKAGE-SECTION data Run-unit Based on scope of underlying data
LOCALE OF special register Same as associated identifier Same as associated identifier
RETURN-CODE Run-unit Program invocation instance
WHEN-COMPILED special register Run-unit Run-unit
WORKING-STORAGE data Run-unit Run-unit
SORT-RETURN special register Run-unit Program invocation instance


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]