Popular

Showing posts with label COBOL PICTURE Clauses. Show all posts
Showing posts with label COBOL PICTURE Clauses. Show all posts

COBOL PICTURE Clauses COBOL Picture Clause Usage Descriptions

Some examples
- PICTURE 999 a three digit (+iveonly) integer
- PICTURE S999 a three digit (+ive/-ive) integer
- PICTURE XXXX a four character text item or string
- PICTURE 99V99 a +ive‘real’in the range 0 to 99.99
- PICTURE S9V9 a +ive/-ive‘real’in the range ?
- If you wish you can use the abbreviation PIC.
- Numeric values can have a maximum of 18 (eighteen) digits (i.e. 9’s).
- The limit on string values is usually system-dependent.


Abbreviating recurring symbols

Recurring symbols can be specified using a ‘repeat’factor inside round brackets
  • PIC 9(6) is equivalent to PICTURE 999999
  • PIC 9(6)V99 is equivalent to PIC 999999V99
  • PICTURE X(10) is equivalent to PIC XXXXXXXXXX
  • PIC S9(4)V9(4) is equivalent to PIC S9999V9999
  • PIC 9(18) is equivalent to PIC 999999999999999999