3.3. Globals

A program consists of a number of segments, each of which may be described as an outermost block, as there is no format block surrounding the segments. In addition to objects that are local to inner blocks or outermost blocks, global objects may be defined. Such objects may be used in any segment, as their scope is the entire program. To become global, an object must be named in a communicator written outside the segments. For some types of object, such as COMMON data references, this takes the form of a declaration (and is the only declaration required). Other types of object, specifically COMMON labels, COMMON switches and COMMON procedures, must be fully defined within a segment. This means that COMMON labels must be set, and COMMON switches and procedures must be declared, in one of the outermost blocks of the program. Such objects are merely "specified" in the COMMON communicator, as described in Section 9.1, and are treated as local in every outermost block of the program. Global objects declared outside the segments are treated as non-local. With these rules of locality, questions of clashing are resolved in accordance with Section 3.2.