PICTURE Clauses

Without S, a numeric item is unsigned: storing −5 stores 5.

8.1 Basic symbols

Alphabetic (letters and space) Implied decimal point (takes no storage) 12345.67 stored as 1234567 Operational sign (separate or embedded) −99999 to +99999 Assumed decimal scaling position 12 means 12000 National (UTF-16) character 10 national characters PIC X(3) = PIC XXX

Without S, a numeric item is unsigned: storing −5 stores 5. Always use S for amounts that can be negative.

8.2 Editing symbols (for display/print fields)

Zero suppression — leading zero replaced by a space Check protection — leading zero replaced by *

Currency sign (fixed or floating when repeated) Comma insertion (suppressed within leading zeros)

Actual decimal point (aligns with V of the source) Sign: + if positive, - if negative (fixed or floating)

Sign: space if positive, - if negative (fixed or floating)

Prints CR if negative, two spaces if positive (right end only)

Prints DB if negative, two spaces if positive (right end only) Blank (space) insertion

8.4 Seeing editing in action

Move a value to an edited item and display it between brackets to see exactly what is produced:

01  WS-AMOUNT            PIC S9(7)V99 VALUE -1234.56.
       01  ED-AMOUNT-1          PIC -Z,ZZZ,ZZ9.99.
       01  ED-AMOUNT-2          PIC Z,ZZZ,ZZ9.99CR.
      * ...
           MOVE WS-AMOUNT TO ED-AMOUNT-1 ED-AMOUNT-2
      *    Displays [-    1,234.56] and [    1,234.56CR]
           DISPLAY "[" ED-AMOUNT-1 "] [" ED-AMOUNT-2 "]"

8.5 Size and limits

Numeric items: up to 18 digits in COBOL-85; 31 digits in IBM Enterprise COBOL with ARITH(EXTEND); up to 38 digits in GnuCOBOL and COBOL 2014.

Edited items are for output; you can move them back to numeric (de-editing), but never do arithmetic on them directly.

BLANK WHEN ZERO makes an edited or numeric display field all spaces when the value is zero.