In this topic, we described about the Reserved Words with detailed example.
A reserved word is a character-string with a predefined meaning in a COBOL source unit. Below are the types of reserved words -
- Optional words
- Figurative constants
- Special character words
- Special registers
|Keywords||Keywords are reserved words that are required in each sentence, entry, or statement. Such keywords appear in uppercase on each sentence, entry, or statement within each program construction.|
|Optional words||Optional words are reserved words that can be included in a sentence, entry, or statement format to improve readability. They have no effect on the execution of the program.|
|Figurative constants||Figurative constants are reserved words that name and refers to specific constant values.|
|Special character words||There are five types of special character words when represented as single-byte characters -
|Special registers||Special registers name storage areas generated by the compiler. Their primary use is to store information produced by specific COBOL features. Each storage area has a fixed name and must not be defined again within the program.|
Below list shows the examples for each type of Reserved Words -
ACCEPT ACCESS ADD AFTER ALL ALPHABET ALPHABETIC ALPHANUMERIC ASCENDING ASSIGN AUTHOR ...
SKIP1 SKIP2 SKIP3 ROUNDED ...
ZERO, ZEROS, ZEROES SPACE, SPACES HIGH-VALUE, HIGH-VALUES LOW-VALUE, LOW-VALUES QUOTE, QUOTES NULL, NULLS ...
|Special character words
ADDRESS OF DEBUG-ITEM FORMAT OF LENGTH OF LINAGE-COUNTER RETURN-CODE SORT-RETURN WHEN-COMPILED ...