Character Set
Character Set
Characters are the basic unit of any programming language, and a set of valid characters createscharacter set. Characters include 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 primary COBOL characters is as follows –
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 again after reading Divisions and Variable declaration topics to get a clear understanding.