Syntax rules
The type of elementary item for which the DISPLAY phrase is written is defined by the character-string in the PICTURE clause.
General rules
The DISPLAY phrase specifies that the data item is to be stored in EBCDIC data format; that is, each character position is represented by one byte.
External decimal data items are internally represented as follows:
Each digit of a number is represented by a single byte. The four high-order bits of each byte are the zone portion. The zone portion of the low-order or high-order byte (depending on the SIGN clause) represents the sign of the number, assuming that a sign exists. The four low-order bits contain the value of the digit.
The maximum length of an external decimal item is 31 digits.
External floating-point items consist of a mantissa, which represents the decimal part of the number, and an exponent with the base 10
The value of an external floating-point item is calculated by multiplying the mantissa by 10 to the power of exponent.
The magnitude of a number represented by a floating-point item must be greater than 5.4 * 10-79 and must not exceed 7.2 * 1079 and must not exceed 7.2 * 1075.An external floating-point item, when used as a numeric operand, is checked at object time and is converted into an internal floating-point item. It is used in this form in arithmetic operations (see notes on COMPUTATIONAL-1 and COMPUTATIONAL-2).
Example 7-30
Data formats for USAGE IS DISPLAY
Data category | Value | PICTURE | Internal representation*) | |||||||||
alphabetic | ABCD | AAAA | C1 | C2 | C3 | C4 | ||||||
alphanumeric | A1B2 | XXXX | C1 | F1 | C2 | F2 | ||||||
alphanumeric | 123AB | XXBXXX | F1 | F2 | 40 | F3 | C1 | C2 | ||||
numeric | 54321 | 99,999 | F5 | F4 | 6B | F3 | F2 | F1 | ||||
numeric external | ||||||||||||
+1234 | 9999 | F1 | F2 | F3 | F4 | |||||||
+6879 | S9999 | F6 | F8 | F7 | C9 | |||||||
-6879 | S9999 | F6 | F8 | F7 | D9 | |||||||
6879 | +99.99E-99 | 4E | F6 | F8 | 4B | F7 | F9 | C5 | 40 | F0 | F2 | |
.6879 | +99.99E-99 | 4E | F6 | F8 | 4B | F7 | F9 | C5 | 60 | F0 | F2 |
*) Each box represents one byte.