Character Set
Character Set
The character is the basic unit of any programming language, and the set of valid characters creates the character set. It includes letters (both uppercase and lowercase), digits, and special characters.
Similarly, the COBOL language has its own set of valid characters (78) that contains alphabets(A-Z/a-z), digits(0-9), and special characters.
The list of basic COBOL characters are –
Character | Meaning | Usage | Example |
---|---|---|---|
Space | Separating character |
| |
+ | Plus | Arithmetic operator |
|
Editing character |
| ||
- | Minus or hyphen | Arithmetic operator |
|
Editing character |
| ||
Continuation character |
| ||
COBOL word element |
| ||
* | Asterisk | Arithmetic operator |
|
Editing character |
| ||
Comment character |
| ||
/ | Forward slash or solidus | Arithmetic operator |
|
Editing character |
| ||
Continuation character |
| ||
= | Equal sign | Separating character |
|
Relation character |
| ||
$ | Currency sign | Editing character |
|
, | Comma | Editing character |
|
Separating character |
| ||
; | Semicolon | Separating character |
|
. | Decimal point or period | Editing character |
|
Separating character |
| ||
" | Quotation mark | Separating character |
|
' | Apostrophe | Separating character |
|
( | Left parenthesis | Separating character |
|
) | Right parenthesis | Separating character |
|
> | Greater than | Relational character |
|
< | Less than | Relational character |
|
: | Colon | Relational character |
|
_ | Underscore | User-defined word element |
|
A - Z | Alphabet (uppercase) | Alphabetic characters |
|
a - z | Alphabet (lowercase) | Alphabetic characters |
|
0 - 9 | Numeric characters | Numeric characters |
|
Note! Read this topic once again after reading the Divisions and variable declarations topics to get a clear understanding.