Symbols used in the PICTURE clause

Any punctuation character that appears within the PICTURE character-string is not considered a punctuation character, but rather is a PICTURE character-string symbol.

When specified in the SPECIAL-NAMES paragraph, DECIMAL-POINT IS COMMA exchanges the functions of the period and the comma in PICTURE character-strings and in numeric literals.

The lowercase letters that correspond to the uppercase letters that represent the following PICTURE symbols are equivalent to their uppercase representations in a PICTURE character-string:


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

All other lowercase letters are not equivalent to their corresponding uppercase representations.

Table 1 defines the meaning of each PICTURE clause symbol. The heading Size indicates how the item is counted in determining the number of character positions in the item. The type of the character positions depends on the USAGE clause specified for the item, as follows:

Usage Type of character positions Number of bytes per character
DISPLAY Alphanumeric 1
DISPLAY-1 DBCS 2
NATIONAL National 2
Start of changeUTF-8End of change Start of changeUTF-8End of change Start of change1 to 4 bytesEnd of change
All others Conceptual Not applicable

Table 1. PICTURE clause symbol meanings
Symbol Meaning Size
A A character position that can contain only a letter of the Latin alphabet or a space. Each 'A' is counted as one character position in the size of the data item.
B For usage DISPLAY, a character position into which an alphanumeric space is inserted.

For usage DISPLAY-1, a character position into which a DBCS space is inserted.

For usage NATIONAL, a character position into which a national space is inserted.

Each 'B' is counted as one character position in the size of the data item.
E Marks the start of the exponent in an external floating-point item. For additional details of external floating-point items, see Data categories and PICTURE rules. Each 'E' is counted as one character position in the size of the data item.
G A DBCS character position. Each 'G' is counted as one character position in the size of the data item.
N A DBCS character position when specified with usage DISPLAY-1 or when usage is unspecified and the NSYMBOL(DBCS) compiler option is in effect.

For category national, a national character position when specified with usage NATIONAL or when usage is unspecified and the NSYMBOL(NATIONAL) compiler option is in effect.

For category national-edited, a national character position.

Each 'N' is counted as one character position in the size of the data item.
P An assumed decimal scaling position. Used to specify the location of an assumed decimal point when the point is not within the number that appears in the data item. See P symbol for further details. Not counted in the size of the data item. Scaling position characters are counted in determining the maximum number of digit positions in numeric-edited items or in items that are used as arithmetic operands.

The size of the value is the number of digit positions represented by the PICTURE character-string.

S An indicator of the presence (but not the representation, and not necessarily the position) of an operational sign. An operational sign indicates whether the value of an item involved in an operation is positive or negative. Not counted in the size of the elementary item, unless an associated SIGN clause specifies the SEPARATE CHARACTER phrase (which would be counted as one character position).
Start of changeU End of change Start of changeA UTF-8 character position. USAGE UTF-8 is assumed whenever a U symbol appears in the PICTURE character-string of a data item.End of change Start of changeEach 'U' counts as one UTF-8 character position in the size of the data item.

If the BYTE-LENGTH phrase of the PICTURE clause is specified, then only one 'U' symbol can be used in the PICTURE clause and the byte length of the data item is indicated in the BYTE-LENGTH phrase, and the number of characters that can be stored in the data item varies and depends on the size of each character.

End of change
V An indicator of the location of the assumed decimal point. Does not represent a character position.

When the assumed decimal point is to the right of the rightmost symbol in the string, the V is redundant.

Not counted in the size of the elementary item.
X A character position that can contain any allowable character from the alphanumeric character set of the computer. Each 'X' is counted as one character position in the size of the data item.
Z A leading numeric character position. When that position contains a zero, a space character replaces the zero. Each 'Z' is counted as one character position in the size of the data item.
9 A character position that contains a numeral. Each nine specifies one decimal digit in the value of the item. For usages DISPLAY and NATIONAL, each nine is counted as one character position in the size of the data item.
0 A character position into which the numeral zero is inserted. Each zero is counted as one character position in the size of the data item.
/ A character position into which the slash character is inserted. Each slash character is counted as one character position in the size of the data item.
, A character position into which a comma is inserted. Each comma is counted as one character position in the size of the data item.
. An editing symbol that represents the decimal point for alignment purposes. In addition, it represents a character position into which a period is inserted. Each period is counted as one character position in the size of the data item.
+
-
CR
DB

Editing sign control symbols. Each represents the character position into which the editing sign control symbol is placed. Each character used in the editing sign symbol is counted as one character position in the size of the data item.
* A check protect symbol: a leading numeric character position into which an asterisk is placed when that position contains a zero. Each asterisk is counted as one character position in the size of the item.
cs cs can be any valid currency symbol. A currency symbol represents a character position into which a currency sign value is placed. The default currency symbol is the character assigned the value X'5B' in the code page in effect at compile time. In this document, the default currency symbol is represented by the dollar sign ($) and cs stands for any valid currency symbol. For details, see Currency symbol. The first occurrence of a currency symbol adds the number of characters in the currency sign value to the size of the data item. Each subsequent occurrence adds one character position to the size of the data item.

The following figure shows the sequences in which picture symbols can be specified to form picture character-strings. More detailed explanations of PICTURE clause symbols follow the figure.

This image shows valid picture symbol sequences. Link to detail.

P symbol

The symbol P specifies a scaling position and implies an assumed decimal point (to the left of the Ps if the Ps are leftmost PICTURE characters; to the right of the Ps if the Ps are rightmost PICTURE characters).

The assumed decimal point symbol V is redundant as either the leftmost or rightmost character within such a PICTURE description.

The symbol P can be specified only as a continuous string of Ps in the leftmost or rightmost digit positions within a PICTURE character-string.

In certain operations that reference a data item whose PICTURE character-string contains the symbol P, the algebraic value of the data item is used rather than the actual character representation of the data item. This algebraic value assumes the decimal point in the prescribed location and zero in place of the digit position specified by the symbol P. The size of the value is the number of digit positions represented by the PICTURE character-string. These operations are any of the following ones:

  • Any operation that requires a numeric sending operand
  • A MOVE statement where the sending operand is numeric and its PICTURE character-string contains the symbol P
  • A MOVE statement where the sending operand is numeric-edited and its PICTURE character-string contains the symbol P, and the receiving operand is numeric or numeric-edited
  • A comparison operation where both operands are numeric

In all other operations, the digit positions specified with the symbol P are ignored and are not counted in the size of the operand.

Currency symbol

The currency symbol in a picture character-string is represented by the default currency symbol $ or by a single character specified either in the CURRENCY compiler option or in the CURRENCY SIGN clause in the SPECIAL-NAMES paragraph of the ENVIRONMENT DIVISION.

Although the default currency symbol is represented by $ in this document, the actual default currency symbol is the character with the value X'5B' in the EBCDIC code page in effect at compile time.

If the CURRENCY SIGN clause is specified, the CURRENCY and NOCURRENCY compiler options are ignored. If the CURRENCY SIGN clause is not specified and the NOCURRENCY compiler option is in effect, the dollar sign ($) is used as the default currency sign value and currency symbol. For more information about the CURRENCY SIGN clause, see CURRENCY SIGN clause. For more information about the CURRENCY and NOCURRENCY compiler options, see CURRENCY in the Enterprise COBOL Programming Guide.

A currency symbol can be repeated within the PICTURE character-string to specify floating insertion. Different currency symbols must not be used in the same PICTURE character-string.

Unlike all other picture symbols, currency symbols are case sensitive. For example, 'D' and 'd' specify different currency symbols.

A currency symbol can be used only to define a numeric-edited item with USAGE DISPLAY.