A COBOL word is a character-string of not more than 30 characters which forms a compiler-directive word, a context-sensitive word, user-defined word, a system-name, a reserved word, or an intrinsic-function-name. Each character of a COBOL word that is not a special character word is selected from the set of letters, digits, the hyphen
and the underscore
or the underscore
may not appear as the first or last character in such words. Each lower-case letter is considered to be equivalent to its corresponding upper-case letter.
The character-string may contain 31 characters.
Within a source element the following apply:
A user-defined word is a COBOL word that must be supplied by the user to satisfy the format of a clause or statement.
The types of user-defined words are:
Within a given source element the following user-defined words are grouped into the following disjoint sets:
All user-defined words, except segment-numbers and level-numbers, can belong to one and only one of these disjoint sets. Furthermore, all user-defined words within a given disjoint set must be unique, except as specified in the section Uniqueness Of Reference.
With the exception of paragraph-name, section-name, level-number and segment-number, all user-defined words must contain at least one alphabetic character
or one occurrence of the hyphen character
Segment-numbers and level-numbers need not be unique; a given specification of a segment-number or level-number can be identical to any other segment-number or level-number and can even be identical to a paragraph-name or section-name.
The following user-defined words are externalized to the operating environment:
If a literal is specified in place of or in addition to one of these names, the content of the literal is the name that is externalized to the operating environment in a case-sensitive manner. If no literal is specified, the externalized name is created by folding the name to upper case. The Compiler directive FOLD-CALL-NAME can be used to control the case of externalized class-names, interface-names and program-names. The F and U options of the Compiler directive OOCTRL can be used to control the case of externalized method-names. +F and -U cause method-names to be folded to lower case, which is the default.
|A condition-name is a name which is assigned to a specific value, set of values, or range of values, within a complete set
of values that a data item can assume. The data item itself is called a conditional variable. Condition-names can be defined
in the Data Division or in the Special-Names paragraph within the Environment Division where a condition-name must be assigned
to one or both of the ON STATUS or OFF STATUS of the run-time switches.
A condition-name is used only as follows:
|A constant-name is a name which is assigned as the name of a fixed value.
|A mnemonic-name assigns a user-defined word to an implementor-name. These associations are established in the Special-Names paragraph of the Environment Division. (See the topic The Special-Names Paragraph.)
|A paragraph-name is a word that names a paragraph in the Procedure Division. Paragraph-names are equivalent if, and only if, they are composed of the same sequence of the same number of characters.
|A section-name is a word that names a section in the Procedure Division. Section-names are equivalent if, and only if, they are composed of the same sequence of the same number of characters.
|Other user-defined words:
|See the Glossary for definitions of all other types of user-defined words.
A system-name is a COBOL word that is used to communicate with the operating environment.
System-names must contain at least one alphabetic character
or one occurrence of the hyphen character
There are three types of system-names:
Within a given implementation these three types of system-names form disjoint sets; a given system-name can belong to one and only one of them.
The system-names listed above are individually defined in the Glossary.
An intrinsic-function-name is a word that is one of a specified list of words which can be used in COBOL source elements. The same word, with the exception of LENGTH, RANDOM and SUM, in a different context, can appear in a source element as a user-defined word or a system-name. (See the topic Definitions of Functions.)
A reserved word is a COBOL word that is one of a specified list of words which can be used in COBOL compilation groups, but which must not appear in the compilation groups as user-defined words or system-names. Reserved words can be used only as specified in the general formats. (See the topic Reserved Words.)
The types of reserved words are:
|A key word is a word whose presence is required when the format in which it appears is used in a compilation group. Within
each format, such words are upper-case and underlined.
Key words are of three types:
|Within each format, upper-case words that are not underlined are called optional words and can appear at the user's discretion. The presence or absence of an optional word does not alter the semantics of the COBOL source element in which it appears.
|Certain words are used to name and reference special registers: special registers are certain storage areas created by your COBOL system, whose primary use is to store information produced in conjunction with the use of specific COBOL features. They are specified in the section Special Registers.
|Certain reserved words are used to name and reference specific constant values. These reserved words are specified in the section Figurative Constant Values.
|Special character words:
|The arithmetic operators and relation characters are reserved words.
|Predefined object identifiers:
|Certain reserved words are used as predefined object identifiers. The predefined object identifiers are:
A context-sensitive word is a COBOL word that is reserved only in the general formats in which it is specified. The same word may also be used as an intrinsic-function-name, a user-defined word or a system-name. Context-sensitive words and the contexts in which they are reserved are specified in the section Context-sensitive Words Table in the appendix Reserved Words.