Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

1.4.1 Types of Names



In addition to identifying a resource, a name can have global or local attributes. Some names are always global, some names are always local, and some names are either local or global depending on specifications in the program in which the names are declared.

For Programs
A global name can be used to refer to the resource with which it is associated both:

  • From within the program in which the global name is declared
    
    
  • From within any other program that is contained in the program that declares the global name
    
    

You use the GLOBAL clause in the data description entry to indicate that a name is global. For more information on using the GLOBAL clause, see "GLOBAL Clause" in topic 5.3.8.

A local name can be used only to refer to the resource with which it is associated from within the program in which the local name is declared.

By default, if a data-name, a file-name, a record-name, or a condition-name declaration in a data description entry does not include the GLOBAL clause, the name is local.


X For Classes and Methods

X Names declared in a class definition are global to all the methods
X contained in that class definition. All names declared in methods are
X implicitly local.

Note: Specific rules sometimes prohibit specifying the GLOBAL clause for certain data description, file description, or record description entries.

The following list indicates the names you can use and whether the name can be local or global:

data-name
Data-name assigns a name to a data item.

A data-name is global if the GLOBAL clause is specified either in the data description entry that declares the data-name, or in another entry to which that data description entry is subordinate.

file-name
File-name assigns a name to a file connector.

A file-name is global if the GLOBAL clause is specified in the file description entry for that file-name.

record-name
Record-name assigns a name to a record.

A record-name is global if the GLOBAL clause is specified in the record description that declares the record-name, or in the case of record description entries in the File Section, if the GLOBAL clause is specified in the file description entry for the file name associated with the record description entry.

condition-name
Condition-name associates a value with a conditional variable.

A condition-name that is declared in a data description entry is global if that entry is subordinate to another entry that specifies the GLOBAL clause.

A condition-name that is declared within the Configuration Section is always global.

program-name
Program-name assigns a name to a program, either external or internal (nested). For more information, see "Conventions for Program-Names" in topic 2.1.1.1.

A program-name is neither local nor global. For more information, see "Conventions for Program-Names" in topic 2.1.1.1.


X method-name

X Method-name assigns a name to a method. A method-name is neither local
X nor global.

section-name
Section-name assigns a name to a section in the Procedure Division.

A section-name is always local.

paragraph-name
Paragraph-name assigns a name to a paragraph in the Procedure Division.

A paragraph-name is always local.

basis-name
Basis-names are treated consistently as defined for text-names without the library-name qualification.

library-name
>_Host_> Under OS/390 and VM, library-name specifies the COBOL library that the compiler uses for a given source program compilation.

A library-name is external to the program and can be referenced by any COBOL program if the compiler system supports the associated library and the entities referenced are known to that system. <_Host_<

>_Workstation_> Under AIX, OS/2, and Windows, a library-name is used to identify the path for the library text.

If you specify library-name with a literal, it is treated as the actual path name. If you specify library-name with a user-defined word, the name is used as an environment variable and the value of the environment variable is used for the path names(s) to locate the COPY text. For details on path names, see "COPY Statement" in topic 8.1.4. <_Workstation_<

text-name

>_Host_> Under OS/390 and VM, text-name assigns a name to library text. A text-name is external to the program and can be referenced by any COBOL program if the compiler system supports the associated library and the entities referenced are known to that system. <_Host_<

>_Workstation_> Under AIX, OS/2, and Windows, a text-name is used to identify the file for the COPY text. For details, see "COPY Statement" in topic 8.1.4. <_Workstation_<

alphabet-name
Alphabet-name assigns a name to a specific character set and/or collating sequence in the SPECIAL-NAMES paragraph of the Environment Division.

An alphabet-name is always global.

class-name
Class-name assigns a name to the proposition in the SPECIAL-NAMES paragraph of the Environment Division for which a truth value can be defined.

A class-name is always global.


X object-oriented class-name

X Object-oriented class-name assigns a name to a class, subclass, or
X metaclass. An object-oriented class-name is always global.


X object-oriented class Working-Storage

X Object-oriented class Working-Storage data items are always global to
X the methods contained in the class definition. They are accessible
X from any contained method.

mnemonic-name
Mnemonic-name assigns a user-defined word to an implementer-name.

A mnemonic-name is always global.

symbolic-character
Symbolic-character specifies a user-defined figurative constant.

A symbolic-name is always global.

index-name
Index-name assigns a name to an index associated with a specific table.

If a data item possessing the GLOBAL attribute includes a table accessed with an index, that index also possesses the GLOBAL attribute. In addition, the scope of that index-name is identical to the scope of the data-name that includes the table.


Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.