COBOL Words

Last Updated : 12 Dec, 2022

COBOL Words are characters like string that can be reserved words or user-defined words. The length can be up to 30 characters. COBOL words must be as from a set of letters, digits, the hyphen, and the underscore.

User-Defined

User-defined words are used for commonly as naming files, operational data, records, big paragraph names, and sections. Alphabets, digits also can hyphen are allowed as forming user-defined words, so cannot use COBOL reserved words.

The types of user-defined words:

Types of User-Defined WordsDefining Rules
alphabet-name
class-name
condition-name
constant-name
data-name
file-name
index-name
locale-name
mnemonic-name
program-name
Each of these words must contain at least one letter
library-name
program-name
text-name
Each of these words must contain one letter. The starting 10 characters must form a unique word

Reserved Words:

Reserved words are the type predefined words in COBOL, Different types of reserved words that we use as constantly-

  • Keywords like Acceptable ADD, ACCEPT, MOVE, etc.
  • Special characters commonly words as +, -, *, <, <=, etc
  • Figurative constants are commonly unique values like ZERO, SPACES, etc. 

Figurative Constants:

Figurative ConstantsDescription
HIGH-VALUESOne or more characters that which having highest position in descending order
LOW-VALUESOne or more characters that have zeros in binary representation.
ZERO/ZEROESOne or more zeros depending on the size of the variable
SPACESOne or more having spaces.
QUOTESSingle or double quotes.
ALL literalFilled the data item with having Literal.
Comment