Summary -
In this topic, we described about the below sections -
- PICTURE symbol is the letter used to specify the type of the variable during the declaration.
- PICTURE character-strings are delimited only by separator space, separator comma, separator semicolon, or separator period.
- PICTURE symbols lowercase letters are equivalent to their uppercase representations.
- PICTURE symbols are two types -
- PICTURE symbol for data types
- PICTURE symbol for editing.
For example -
A, B, E, G, N, P, S, V, X, Z, CR, DB.
PICTURE symbol for data types -
PICTURE symbol for data types specifies the PICTURE symbols assigned for each data type in COBOL. Those are -
Data Type | PICTURE Symbol | Declaration Meaning | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Alphabetic | A | Alphabetic character or space. Represents alphabetic data type. For example -
|
|||||||||||||||
Numeric | 9 | Numeric character. Represents numeric data type. For example -
|
|||||||||||||||
Alphanumeric | X | Alphanumeric character or space. Represents alphanumeric data type. For example -
|
|||||||||||||||
Assumed decimal point | V | Represents the decimal point. It is not counted in the size of the data item/variable. For example -
| |||||||||||||||
Operational sign | S | Represents the Sign of the value. It is not counted in the size of the variable unless a SIGN clause with the SEPARATE CHARACTER phrase is specified. For example -
|
PICTURE symbol for editing -
PICTURE symbol for editing used to represent the data in the user expected format. PICTURE clause editing has two types to represent the data in user-specified format -
Type | PIC Symbols | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Insertion editing |
|
||||||||||
ZERO suppression and replacement editing |
|
Examples -
Below are the total PICTURE clause symbol list -
Symbol | Declaration Meaning | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | Space insertion character. Represents numeric-edited and alphanumeric-edited character. For example -
| ||||||||||||
P | Decimal scaling position but not counted in size of data item.
For example -
| ||||||||||||
Z | Zero suppression character.
For example -
| ||||||||||||
0 | Zero insertion character.
For example -
| ||||||||||||
/ | Slash insertion character.
For example -
| ||||||||||||
, | Comma insertion character.
For example -
| ||||||||||||
. | Decimal point or period editing control character.
For example -
| ||||||||||||
+ | Plus sign insertion editing control character.
For example -
| ||||||||||||
- | Minus sign editing control character.
For example -
| ||||||||||||
CR | Credit editing control character.
For example -
| ||||||||||||
DB | Debit editing control character or Check protect insertion character.
For example -
| ||||||||||||
$ | Currency symbol insertion character. $ is the default.
For example -
|