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
.
The hyphen
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:
constant-names,
data-names,
property-names,
record-names,
split-key-names
typedef-names
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:
class-names,
function-prototype-names, interface-names,
method-names,
program-prototype-names, user-function-names
.
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 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 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.