|
4.1 Number Formats
There are three types of number formats (that I'm aware of): DISPLAY, PACKED-DECIMAL (or COMPUTATIONAL-3 aka COMP-3),
and BINARY. These are defined in the data division after the PIC clause (although DISPLAY format is default
so you don't really have to define it). In DISPLAY format (aka character format) a single digit (i.e. PIC 9)
would use 1 byte (8 bits) of memory. In order to save space and processing time, calculation can be performed
in a more economical way using COMP-3 or BINARY formats. This is because they use less bytes:
01 ITEM-1 PIC 9(3) VALUE 123 USAGE IS BINARY.
This uses 1 byte: 123 (one-hundred and twenty-three) is converted into binary: 01111011
Both 'USAGE' and 'IS' are optional (as is 'DISPLAY').
| ||||