Below examples explains how various data types are internally stored in memory
PIC S9999 DISPLAY
Value :+ 1234
Internal representation: F1 F2 F3 C4
Value :- 1234
Internal representation: F1 F2 F3 D4
Value : 1234
Internal representation: F1 F2 F3 C4
PIC 9999 DISPLAY
Value : 1234
Internal representation: F1 F2 F3 F4
PIC S9999 DISPLAY SIGN LEADING
Value :+ 1234
Internal representation: C1 F2 F3 F4
Value :- 1234
Internal representation: D1 F2 F3 F4
PIC S9999 DISPLAY SIGN LEADING SEPARATE
Value :+ 1234
Internal representation: 4E F1 F2 F3 F4
Value :- 1234
Internal representation: 60 F1 F2 F3 F4
PIC S9999 DISPLAY SIGN TRAILING SEPARATE
Value :+ 1234
Internal representation: F1 F2 F3 F4 4E
Value :- 1234
Internal representation: F1 F2 F3 F4 60
PIC S9999 BINARY /PIC S9999 COMP/PIC S9999 COMP-4
Value :+ 1234
Internal representation: 04 D2
Value :- 1234
Internal representation: FB 2E
PIC S9999 COMP-5
Value :+ 123451
Internal representation: 30 39
Value :- 123451
Internal representation: CF C7
PIC 9999 COMP-5
Value : 600001
Internal representation: EA 60
The example demonstrates that COMP-5 data items can contain values of magnitude up to the capacity of the native binary representation (2, 4,or 8 bytes), rather than being limited to the value implied by the number of 9s in the PICTURE clause.