Summary -

In this topic, we described about the PICTURE Symbols and Character Strings with detailed example.

PICTURE symbol is the letter used to specify the PICTURE clause of the data item/variable during the declaration. A PICTURE character-string is a combination of the currency symbol and certain characters in the COBOL character set.

PICTURE character-strings are delimited only by separator space, separator comma, separator semicolon, or separator period.

The below PICTURE symbols lowercase letters are equivalent to their uppercase representations in a PICTURE character-string -

A, B, E, G, N, P, S, V, X, Z, CR, DB.

Below is the PICTURE clause symbol list -

Symbol Declaration Meaning
A Alphabetic character or space.
For example -
Input PICTURE Clause Output
HELLO PIC A(5) HELLO
B Space insertion character.
For example -
Input PICTURE Clause Output
150682 PIC 99B99B99 15 06 82
15061982 PIC 99B99B9999 15 06 1982
P Decimal scaling position but not counted in size of data item.
For example -
Input PICTURE Clause Output
77 PIC 99P 77
77 PIC P99 77
S Operational sign. It is not counted in the size of the variable unless a SIGN clause with the SEPARATE CHARACTER phrase is specified.
For example -
Input PICTURE Clause Output
-123 PIC S999 12L
+123 PIC S999 12C
-123 PIC S999 SIGN IS LEADING SEPERATE CHARACTER -123
-123 PIC S999 SIGN IS TRAILING SEPERATE CHARACTER 123-
V Assumed decimal point. It is not counted in the size of the data item/variable.
For example -
Input PICTURE Clause Output
123.45 PIC 999V99 12345
123.45 PIC 99V99 2345
X Alphanumeric character.
For example -
Input PICTURE Clause Output
HELLO PIC X(5) HELLO
HI PIC X(5) HI
Z Zero suppression character.
For example -
Input PICTURE Clause Output
123 PIC ZZZZZ. 123
000123 PIC ZZZZZZ. 123
9 Numeric character.
For example -
Input PICTURE Clause Output
123 PIC 9(5). 00123
000123 PIC 9(4). 0123
0 Zero insertion character.
For example -
Input PICTURE Clause Output
1234 PIC 990099. 120034
1234 PIC 999900. 123400
/ Slash insertion character.
For example -
Input PICTURE Clause Output
150682 PIC 99/99/99. 15/06/82
, Comma insertion character.
For example -
Input PICTURE Clause Output
123456 PIC 999,999. 123,456
12345 PIC zzz,999. 12345
. Decimal point or period editing control character.
For example -
Input PICTURE Clause Output
1234.56 PIC 9999.99. 1234.56
1234.56 PIC 999.99. 234.56
1234.56 PIC 9999.9. 1234.5
+ Plus sign insertion editing control character.
For example -
Input PICTURE Clause Output
+12345 PIC +9(5). +12345
-123 PIC +9(3). -123
-123 PIC 9(3)+. 123-
- Minus sign editing control character.
For example -
Input PICTURE Clause Output
-123 PIC -9(3). -123
+123 PIC +9(3). 123
-123 PIC 9(3)-. 123-
CR Credit editing control character.
For example -
Input PICTURE Clause Output
+123 PIC 9(3)CR. 123
-123 PIC 9(3)CR. 123CR
DB Debit editing control character or Check protect insertion character.
For example -
Input PICTURE Clause Output
+123 PIC 9(3)DB. 123
-123 PIC 9(3)DB. 123DB
$ Currency symbol insertion character. $ is the default.
For example -
Input PICTURE Clause Output
000 PIC $,$$9.99. 0.00
90 PIC $$9.00. $90.00
12345 PIC $$,$$9. $2,345