In this topic, we have explained Character Strings with detailed examples.
- Character-string is a single character or set of adjacent characters that can create a COBOL word, literal, a PICTURE string, or a comment.
- Separators delimit character strings.
Character-strings are used to create the below objects -
|Character string types||Description|
|COBOL Word||A COBOL word is a set of characters that creates a user-defined word, a system name, or a reserved word.|
|Variable||A Variable is an identifier used to hold the value for processing in the program.|
|Literal||A literal is a group of characters or a group of words, or a figurative constant.|
|Constant||A constant is a variable that contains a unique value throughout the program execution and doesn't change in the middle.|
|PICTURE string||PICTURE clause is used to specify the type of the variable. i.e., variable type, length, etc.|
|Comment||A comment is a group of characters used to provide the notes about the code or the information about tasks coded in the program.|
Below list shows the examples for each character-string -
|PICTURE Character String||
Note! The astrik (*) should be coded in the column 7 to make it as comment.
Practical Example -
Below screenshot describes how the different types of words formed using character sets in COBOL programming.