b_book1.gif (162 bytes) Data - Coding systems (EBCDIC)

Encoding numeric data - EBCDIC

EBCDIC Decimals - single digit

Decimal digits can be represented in EBCDIC in either of two formats: zoned decimal or packed decimal.

Zoned:

Zone Portion | Numeric Portion  
Z | Z | Z | Z | 8 | 4 | 2 | 1  
1 | 1 | 1 | 1
1 | 1 | 0 | 0
1 | 1 | 0 | 1
| 1 | 0 | 0 | 1
| 1 | 0 | 0 | 1
| 1 | 0 | 0 | 1
11111001 = 9
11001001 = +9
11011001 = -9

EBCDIC Decimals - numbers

+437 Zoned:

<byte>

<byte>

<byte>

1 1 1 1 : 0 1 0 0

1 1 1 1 : 0 0 1 1

1 1 0 0 : 0 1 1 1

zone ( ) : digit(4)
%

zone ( ) : digit(3)
#

zone(+) : digit(7)
@ : &

+437 Packed:

here the sign nibble occupies the final digit area.

<byte>

<byte>

0 1 0 0 : 0 0 1 1

0 1 1 1 : 1 1 0 0

digit(4) : digit (3)
% : #

digit(7) : zone(+)
& : @

[Rev 17/9/98] 27/4/97 © 1997-98 V/2-Com (Verhaart), P O Box 8415, Havelock North, New Zealand.