TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

COBOL - Picture Clause Symbols


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 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).
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
CD
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 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.

Things to noted:
  • 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, V, X, Z, CR, DB

  • All other lowercase letters are not equivalent to their corresponding uppercase representations.
Above table 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
All others Conceptual Not applicable

If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal