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

COBOL - Picture Clause


  • The Picture clause is used to specify the type and size of an elementary data item.

  • It consists of the word PIC or PICTURE followed by the actual picture clause, where the type and size are specified.

  • The type is specified using a specific character selected from the table below. Each picture character represents one position in the data item. Different characters may be combined within the same Picture clause.

  • Multiple occurrences of the same type of character are indicated by repeating the character or including a repetition factor after the character.

For example, three alphabetic characters may be represented either with the clause PIC AAA or PIC A(3).

Typically, repetitions of less han four characters are done by repeating the character and repetitions of four or more characters are done with the number enclosed in parentheses.

Data Representation Characters:

Character Purpose Description
X Any character May contain any character including special or unprintable characters
9 Numeric character May contain only the characters 0 through 9
A Alphabetic character May contain only the characters A - Z, a - z, and space

Arithmetic Positioning Characters:

Character Purpose Description
S Numeric sign Does not use any actual storage space, without this character a numeric item would be treated as unsigned
V Implied decimal point Does not use any actual storage space, separates the integer portion of a numeric item from its decimal portion; used to keep track of the decimal point for arithmetic calculations; this character will not print or display; use the actual decimal point character, ".", f r printing
P Numeric place holder Does not use any actual storage space; used to change precision, e.g. 99PPP will hold values in amounts of even 1,000 from zero to 99,000 without actually storing anything for the three lowest order positions; can also be used to represent positions after the decimal, e.g. PP9 will hold values in amounts in even thousandths, from 0 to .009 without actually storing anything for the two highest order positions
Numeric Editing Characters:

Character Purpose Description
- Minus sign Used to display a sign in a printed item, the "-" character will be showed only if the numeric value is negative, the position will be left blank for positive values
+ Plus sign Used to display a sign in a printed item, "-" will be shown for negative values, "+" will be shown for positive values
. Actual decimal point Separates the integer portion of a numeric item from its decimal portion; this character cannot be used in an item involved in a calculation; use the implied decimal point character, "V", for calculations
Z Zero Suppress Replaces leading zeros with blanks; has no effect on non-zero positions or zeros not in leading positions
, Comma Inserts a comma into the data item in this position; commonly used as a separator in numeric data items
$ Dollar sign Inserts a dollar sign into the first position in the data item; commonly used for currency
* Asterisk Replaces leading zeros with asterisks; has no effect on non-zero positions or zeros not in leading positions; commonly used in check writing
CR Credit Used at the end of a PICTURE clause, the CR will appear in the position indicated if the item is negative; will b blank for a positive number
DB Debit Used at the end of a PICTURE clause, the DB will appear in the position indicated if the item is negative; will b blank for a positive number
/ Slash Inserts a slash into the data item in this position; commonly used as a separator in date fields
0 Zero Inserts a zero into the data item in this position; not commonly used


Complete list of picture clause symbols, see here

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