PIC is the standard abbreviation for PICTURE. Both keywords define the format of a data item in the Data Division: its length, type (numeric, alphanumeric, alphabetic), decimal position, sign, and for edited fields how the value is displayed. PIC and PICTURE are interchangeable; for the full set of picture characters and examples see PICTURE clause.
There is no difference. PIC and PICTURE are the same clause. The COBOL standard allows the abbreviated form PIC; most programmers use PIC for brevity. The compiler treats both identically.
12345WORKING-STORAGE SECTION. 01 WS-NAME PIC X(30). 01 WS-AMOUNT PICTURE 9(7)V99. 01 WS-CODE PIC A(5). *> PIC and PICTURE are the same
PIC (or PICTURE) appears in the Data Division on data description entries. It follows the level number and optional data name. It defines how the item is stored and, for edited pictures, how it is displayed (e.g. with commas, dollar sign, or suppressed leading zeros).
| Clause | Meaning |
|---|---|
| PIC X(20) | 20-character alphanumeric field |
| PIC 9(5)V99 | Numeric with 5 integer and 2 decimal places |
| PICTURE A(10) | 10-character alphabetic (letters and space) |
| PIC S9(4) | Signed 4-digit integer |
The characters inside the clause (9, X, A, V, S, Z, $, etc.) define the format. For a full list and explanation of each character see the PICTURE clause quick reference.
PIC (or PICTURE) is the “shape” of a box: “this box holds 20 letters and numbers” or “this box holds a number with two digits after the dot.” Same shape whether you say PICTURE or PIC.
1. What does PIC stand for in COBOL?
2. Are PIC and PICTURE interchangeable?