EBCDIC
This article needs additional citations for verification. (January 2019) |
Classification | 8-bit basic Latin encodings (non‑ASCII) |
---|---|
Preceded by | BCD |
Extended Binary Coded Decimal Interchange Code[1] (EBCDIC;[1] /ˈɛbsɪdɪk/) is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding six-bit binary-coded decimal code used with most of IBM's computer peripherals of the late 1950s and early 1960s.[2] It is supported by various non-IBM platforms, such as Fujitsu-Siemens' BS2000/OSD, OS-IV, MSP, and MSP-EX, the SDS Sigma series, Unisys VS/9, Unisys MCP and ICL VME.
History[edit]
![](http://webcf.waybackmachine.org/web/20220126190701im_/https://upload.wikimedia.org/wikipedia/en/thumb/1/16/Blue-punch-card-front-horiz_top-char-contrast-stretched.png/420px-Blue-punch-card-front-horiz_top-char-contrast-stretched.png)
EBCDIC was devised in 1963 and 1964 by IBM and was announced with the release of the IBM System/360 line of mainframe computers. It is an eight-bit character encoding, developed separately from the seven-bit ASCII encoding scheme. It was created to extend the existing Binary-Coded Decimal (BCD) Interchange Code, or BCDIC, which itself was devised as an efficient means of encoding the two zone and number punches on punched cards into six bits. The distinct encoding of 's' and 'S' (using position 2 instead of 1) was maintained from punched cards where it was desirable not to have hole punches too close to each other to ensure the integrity of the physical card.[citation needed]
While IBM was a chief proponent of the ASCII standardization committee,[3] the company did not have time to prepare ASCII peripherals (such as card punch machines) to ship with its System/360 computers, so the company settled on EBCDIC.[2] The System/360 became wildly successful, together with clones such as RCA Spectra 70, ICL System 4, and Fujitsu FACOM, thus so did EBCDIC.
All IBM mainframe and midrange peripherals and operating systems use EBCDIC as their inherent encoding[4] (with toleration for ASCII, for example, ISPF in z/OS can browse and edit both EBCDIC and ASCII encoded files). Software and many hardware peripherals can translate to and from encodings, and modern mainframes (such as IBM Z) include processor instructions, at the hardware level, to accelerate translation between character sets.
There is an EBCDIC-oriented Unicode Transformation Format called UTF-EBCDIC proposed by the Unicode consortium, designed to allow easy updating of EBCDIC software to handle Unicode, but not intended to be used in open interchange environments. Even on systems with extensive EBCDIC support, it has not been popular. For example, z/OS supports Unicode (preferring UTF-16 specifically), but z/OS only has limited support for UTF-EBCDIC.
Not all IBM products use EBCDIC; IBM AIX, Linux on IBM Z, and Linux on Power all use ASCII.
Compatibility with ASCII[edit]
There were numerous difficulties to writing software that would work in both ASCII and EBCDIC.
- The gaps between letters made simple code that worked in ASCII fail on EBCDIC. For example
for (c = 'A'; c <= 'Z'; ++c) putchar(c);
would print the alphabet from A to Z if ASCII is used, but print 41 characters (including a number of unassigned ones) in EBCDIC. Fixing this required complicating the code with function calls which was greatly resisted by programmers. - Sorting EBCDIC put lowercase letters before uppercase letters and letters before numbers, exactly the opposite of ASCII.
- Programming languages and file formats and network protocols designed for ASCII quickly made use of available punctuation marks (such as the curly braces { and }) that did not exist in EBCDIC, making translation to EBCDIC systems difficult. Conversely EBCDIC had a few characters such as ¢ (US cent) that got used on IBM systems and could not be translated to ASCII.
- The most common newline convention used with EBCDIC is to use a NEL (NEXT LINE) code between lines. Converters to other encodings often replace NEL with LF or CR/LF, even if there is a NEL in the target encoding. This causes the LF and NEL to translate to the same character and be unable to be distinguished.
- If seven-bit ASCII was used, there was an "unused" high bit in 8-bit bytes, and many pieces of software stored other information there. Software would also pack the seven bits and discard the eighth, such as packing five seven-bit ASCII characters in a 36-bit word.[5] On the PDP-11 bytes with the high bit set were treated as negative numbers, behavior that was copied to C, causing unexpected problems if the high bit was set. These all made it difficult to switch from ASCII to the 8-bit EBCDIC (and also made it difficult to switch to 8-bit extended ASCII encodings).
Code page layout[edit]
There are hundreds of EBCDIC code pages based on the original EBCDIC character encoding; there are a variety of EBCDIC code pages intended for use in different parts of the world, including code pages for non-Latin scripts such as Chinese, Japanese (e.g., EBCDIC 930, JEF, and KEIS), Korean, and Greek (EBCDIC 875). There is also a huge number of variations with the letters swapped around for no discernible reason.
The table below shows the "invariant subset"[6] of EBCDIC, which are characters that should have the same assignments on all EBCDIC code pages that use the Latin alphabet (this includes most of the ISO/IEC 646 invariant repertoire, except the exclamation mark). It also shows (in gray) missing ASCII and EBCDIC punctuation, located where they are in Code Page 37 (one of the code page variants of EBCDIC). The blank cells are filled with region-specific characters in the variants, but the characters in gray are often swapped around or replaced as well.
EBCDIC | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
0x | NUL | SOH | STX | ETX | SEL | HT | RNL | DEL | GE | SPS | RPT | VT | FF | CR | SO | SI |
1x | DLE | DC1 | DC2 | DC3 | RES/ ENP |
NL | BS | POC | CAN | EM | UBS | CU1 | IFS | IGS | IRS | IUS/ ITB |
2x | DS | SOS | FS | WUS | BYP/ INP |
LF | ETB | ESC | SA | SFE | SM/ SW |
CSP | MFA | ENQ | ACK | BEL |
3x | SYN | IR | PP | TRN | NBS | EOT | SBS | IT | RFF | CU3 | DC4 | NAK | SUB | |||
4x | SP | ¢ | . | < | ( | + | | | |||||||||
5x | & | ! | $ | * | ) | ; | ¬ | |||||||||
6x | - | / | ¦ | , | % | _ | > | ? | ||||||||
7x | ` | : | # | @ | ' | = | " | |||||||||
8x | a | b | c | d | e | f | g | h | i | ± | ||||||
9x | j | k | l | m | n | o | p | q | r | |||||||
Ax | ~ | s | t | u | v | w | x | y | z | |||||||
Bx | ^ | [ | ] | |||||||||||||
Cx | { | A | B | C | D | E | F | G | H | I | ||||||
Dx | } | J | K | L | M | N | O | P | Q | R | ||||||
Ex | \ | S | T | U | V | W | X | Y | Z | |||||||
Fx | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | EO |
Definitions of non-ASCII EBCDIC controls[edit]
Following are the definitions of EBCDIC control characters which either do not map onto the ASCII control characters, or have additional uses. When mapped to Unicode, these are mostly mapped to C1 control character codepoints in a manner specified by IBM's Character Data Representation Architecture (CDRA).[7][8]
Although the default mapping of New Line (NL) corresponds to the ISO/IEC 6429 Next Line (NEL) character (the behaviour of which is also specified, but not required, in Unicode Annex 14),[9] most of these C1-mapped controls match neither those in the ISO/IEC 6429 C1 set, nor those in other registered C1 control sets such as ISO 6630.[10] Although this effectively makes the non-ASCII EBCDIC controls a unique C1 control set, they are not among the C1 control sets registered in the ISO-IR registry,[11] meaning that they do not have an assigned control set designation sequence (as specified by ISO/IEC 2022, and optionally permitted in ISO/IEC 10646 (Unicode)).[12]
Besides U+0085 (Next Line), the Unicode Standard does not prescribe an interpretation of C1 control characters, leaving their interpretation to higher level protocols (it suggests, but does not require, their ISO/IEC 6429 interpretations in the absence of use for other purposes),[13] so this mapping is permissible in, but not specified by, Unicode.
Mnemonic | EBCDIC | CDRA pairing[7][8] | Name | Description[14] |
---|---|---|---|---|
SEL | 04 | 009C | Select | Device control character taking a single-byte parameter. |
PF | Punch Off | Listed in this location by GOST 19768-93.[15] | ||
RNL | 06 | 0086 | Required New Line | Line-break resetting Indent Tab mode |
LC | Lower Case | Listed in this location by GOST 19768-93.[15] | ||
GE | 08 | 0097 | Graphic Escape | Non-locking shift that changes the interpretation of the following character (see e.g. Code page 310). Compare ISO/IEC 6429's SS2 (008E). |
SPS | 09 | 008D | Superscript | Begin superscript or undo subscript. Compare ISO/IEC 6429's PLU (008C). |
RPT | 0A | 008E | Repeat | Switch to an operation mode repeating a print buffer |
SMM | Start of Manual Message | Listed in this location by GOST 19768-93.[15] | ||
RES/ENP | 14 | 009D | Restore, Enable Presentation | Resume output (after BYP/INP) |
NL | 15 | 0085 (000A) | New Line | Line break. Default mapping (0085) matches ISO/IEC 6429's NEL. Mappings sometimes swapped with Line Feed (EBCDIC 0x25) in accordance with UNIX line breaking convention.[7] |
POC | 17 | 0087 | Program Operator Communication | Followed by two one-byte operators that identify the specific function, for example a light or function key. Contrast with ISO/IEC 6429's CSI (009B), OSC (009D) and APC (009F). |
IL | Idle | Listed in this location by GOST 19768-93.[15] | ||
UBS | 1A | 0092 | Unit Backspace | A fractional backspace. |
CC | Cursor Control | Listed in this location by GOST 19768-93.[15] | ||
CU1 | 1B | 008F | Customer Use One | Not used by IBM; for customer use. |
IUS/ITB | 1F | 001F | Interchange Unit Separator, Intermediate Transmission Block | Either used as an information separator to terminate a block called a "unit" (as in ASCII; see also IR), or used as a transmission control code to delimit the end of an intermediate block. |
DS | 20 | 0080 | Digit Select | Used by S/360 CPU edit (ED) instruction |
SOS | 21 | 0081 | Start of Significance | Used by S/360 CPU edit (ED) instruction. (Note: different from ISO/IEC 6429's SOS.) |
FS,[14] FDS[15] | 22 | 0082 | Field Separator | Used by S/360 CPU edit (ED) instruction. (Note: (Interchange) File Separator, as abbreviated FS in ASCII, is at 0x1C and abbreviated IFS.)[14] |
WUS | 23 | 0083 | Word Underscore | Underscores the immediately preceding word. Contrast with ISO/IEC 6429's SGR. |
BYP/INP | 24 | 0084 | Bypass, Inhibit Presentation | De-activates output, i.e. ignores all graphical characters and control characters besides transmission control codes and RES/ENP, until the next RES/ENP. |
SA | 28 | 0088 | Set Attribute | Marks the beginning of a fixed-length device specific control sequence. Deprecated in favour of CSP. |
SFE | 29 | 0089 | Start Field Extended | Marks the beginning of a variable-length device specific control sequence. Deprecated in favour of CSP. |
SM/SW | 2A | 008A | Set Mode, Switch | Device specific control that sets a mode of operation, such as a buffer switch. |
CU2 | 2B | 008B | Customer Use Two | This appears in some specifications, such as GOST 19768-93;[15] newer IBM specifications for EBCDIC control codes list only CU1 and CU3 as customer-use, and use this position for CSP.[14] |
CSP | Control Sequence Prefix | Marks the beginning of a variable-length device specific control sequence. Followed by a class byte specifying a category of control function, a count byte giving the sequence length (including count and type bytes, but not the class byte or initial CSP), a type byte identifying a control function within that category, and zero or more parameter bytes. Contrast with ISO/IEC 6429's DCS (0090) and CSI (009B). | ||
MFA | 2C | 008C | Modify Field Attribute | Marks the beginning of a variable-length device specific control sequence. Deprecated in favour of CSP. |
30 | 0090 | (reserved) | Reserved for future use by IBM | |
31 | 0091 | (reserved) | Reserved for future use by IBM | |
IR | 33 | 0093 | Index Return | Either move to start of next line (see also NL), or terminate an information unit (see also IUS/ITB). |
PP | 34 | 0094 | Presentation Position | Followed by two one-byte parameters (firstly function, secondly number of either column or line) to set the current position. Contrast with ISO/IEC 6429's CUP and HVP. |
PN | Punch On | Listed in this location by GOST 19768-93.[15] | ||
TRN | 35 | 0095 | Transparent | Followed by one byte parameter that indicates the number of bytes of transparent data that follow. |
RST | Reader Stop | Listed in this location by GOST 19768-93.[15] | ||
NBS | 36 | 0096 | Numeric Backspace | Move backward the width of one digit. |
UC | Upper Case | Listed in this location by GOST 19768-93.[15] | ||
SBS | 38 | 0098 | Subscript | Begin subscript or undo superscript. Compare ISO/IEC 6429's PLD (008B). |
IT | 39 | 0099 | Indent Tab | Indents the current and all following lines, until RNL or RFF is encountered. |
RFF | 3A | 009A | Required Form Feed | Page-break resetting Indent Tab mode. |
CU3 | 3B | 009B | Customer Use Three | Not used by IBM; for customer use. |
3E | 009E | (reserved) | Reserved for future use by IBM | |
EO | FF | 009F | Eight Ones | All ones character used as filler |
Code pages with Latin-1 character sets[edit]
The following code pages have the full Latin-1 character set (ISO/IEC 8859-1). The first column gives the original code page number. The second column gives the number of the code page updated with the euro sign (€) replacing the universal currency sign (¤) (or in the case of EBCDIC 924, with the set changed to match ISO 8859-15)
CCSID | Euro update |
Countries |
---|---|---|
037 | 1140 | Australia, Brazil, Canada, New Zealand, Portugal, South Africa, USA |
273 | 1141 | Austria, Germany |
277 | 1142 | Denmark, Norway |
278 | 1143 | Finland, Sweden |
280 | 1144 | Italy |
284 | 1145 | Latin America, Spain |
285 | 1146 | Ireland, United Kingdom |
297 | 1147 | France |
500 | 1148 | International |
871 | 1149 | Iceland |
1047 | 924 | Open Systems (MVS C compiler) |
Criticism and humor[edit]
Open-source software advocate and software developer Eric S. Raymond writes in his Jargon File that EBCDIC was loathed by hackers, by which he meant[16] members of a subculture of enthusiastic programmers. The Jargon File 4.4.7 gives the following definition:[17]
EBCDIC: /eb´s@·dik/, /eb´see`dik/, /eb´k@·dik/, n. [abbreviation, Extended Binary Coded Decimal Interchange Code] An alleged character set used on IBM dinosaurs. It exists in at least six mutually incompatible versions, all featuring such delights as non-contiguous letter sequences and the absence of several ASCII punctuation characters fairly important for modern computer languages (exactly which characters are absent varies according to which version of EBCDIC you're looking at). IBM adapted EBCDIC from punched card code in the early 1960s and promulgated it as a customer-control tactic (see connector conspiracy), spurning the already established ASCII standard. Today, IBM claims to be an open-systems company, but IBM's own description of the EBCDIC variants and how to convert between them is still internally classified top-secret, burn-before-reading. Hackers blanch at the very name of EBCDIC and consider it a manifestation of purest evil.
— The Jargon file 4.4.7
EBCDIC design was also the source of many jokes. One such joke, found in the Unix fortune file of 4.3BSD Tahoe (1990)[18] went:
Professor: "So the American government went to IBM to come up with an encryption standard, and they came up with—"
Student: "EBCDIC!"
References to the EBCDIC character set are made in the 1979 computer game series Zork. In the "Machine Room" in Zork II, EBCDIC is used to imply an incomprehensible language:
This is a large room full of assorted heavy machinery, whirring noisily. The room smells of burned resistors. Along one wall are three buttons which are, respectively, round, triangular, and square. Naturally, above these buttons are instructions written in EBCDIC...
In 2021, it became public that a Belgian bank was still using EBCDIC internally in 2019. This came to attention because a customer insisted that the correct spelling of his surname included an umlaut, which the bank omitted. The customer filed a complaint citing the guarantee in the General Data Protection Regulation of the right to timely "rectification of inaccurate personal data." The bank argued in part that it could not comply because its computer system was only compatible with EBCDIC, which does not support umlauted letters. The appeals court ruled in favor of the customer.[19][20]
See also[edit]
References[edit]
- ^ a b Mackenzie, Charles E. (1980). Coded Character Sets, History and Development. The Systems Programming Series (1 ed.). Addison-Wesley Publishing Company, Inc. ISBN 0-201-14460-3. LCCN 77-90165. ISBN 978-0-201-14460-4. Retrieved 2016-05-22. [1]
- ^ a b Bemer, Bob. "EBCDIC and the P-Bit (The Biggest Computer Goof Ever) - Computer History Vignettes". Archived from the original on 2018-05-13. Retrieved 2013-07-02.
...but their printers and punches were not ready to handle ASCII, and IBM just HAD to announce.
- ^ "X3.4-1963". 1963. p. 4. Archived from the original on 2016-08-12. (NB. IBM had four staff members on the final 21-member ASA X3.2 sub-committee.)
- ^ IBMnt (2008). "IBM confirms the use of EBCDIC in their mainframes as a default practice". Archived from the original on 2019-03-21. Retrieved 2008-06-16.
- ^ PDP-10 Reference Handbook, Book 2: Assembling the Source Program (PDF). Digital Equipment Corporation. p. 221.
- ^ "Invariant character set". IBM Knowledge Center.
- ^ a b c Umamaheswaran, V.S. (1999-11-08). "3.3 Step 2: Byte Conversion". UTF-EBCDIC. Unicode Consortium. Unicode Technical Report #16.
The 64 control characters...the ASCII DELETE character (U+007F)...are mapped respecting EBCDIC conventions, as defined in IBM Character Data Representation Architecture, CDRA, with one exception -- the pairing of EBCDIC Line Feed and New Line control characters are swapped from their CDRA default pairings to ISO/IEC 6429 Line Feed (U+000A) and Next Line (U+0085) control characters
- ^ a b Steele, Shawn (1996-04-24). cp037_IBMUSCanada to Unicode table. Microsoft/Unicode Consortium.
- ^ Heninger, Andy (2019-02-15). "NL: Next Line (A) (Non-tailorable)". Unicode Line Breaking Algorithm. Revision 43. Unicode Consortium. Unicode Standard Annex #14.
- ^ ISO/TC 46 (1986-02-01). Additional Control Functions for Bibliographic Use according to International Standard ISO 6630 (PDF). ITSCJ/IPSJ. ISO-IR-124.
- ^ ISO/IEC International Register of Coded Character Sets To Be Used With Escape Sequences (PDF), ITSCJ/IPSJ, ISO-IR
- ^ ISO/IEC JTC 1/SC 2 (2017). "12.4: Identification of control function set". Information technology — Universal Coded Character Set (UCS) (5th ed.). ISO. pp. 19–20. ISO/IEC 10646.
For other C0 or C1 sets, the final octet F shall be obtained from the International Register of Coded Character Sets....If such an escape sequence appears within a code unit sequence conforming to this International Standard, it shall be padded in accordance with Clause 11.
- ^ Unicode Consortium (2019). "23.1: Control Codes" (PDF). The Unicode Standard (12.0.0 ed.). pp. 868–870. ISBN 978-1-936213-22-1.
- ^ a b c d "Appendix G-1. EBCDIC control character definitions". Character Data Representation Architecture. IBM Corporation. Archived from the original on 2018-09-11.
- ^ a b c d e f g h i j GOST (1993). "Информационная технология. Наборы 8-битных кодированных символов. Двоичный код обработки информации" (in Russian). GOST 19768-93.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ Raymond, Eric S. (1997). "The New Hacker's Dictionary". p. 310.
- ^ "EBCDIC". Jargon File. Archived from the original on 2018-05-13. Retrieved 2018-05-13.
- ^ 4.3BSD-Reno/share/games/fortune/fortunes
- ^ "Court of Appeal of Brussels - 2019/AR/1006 - GDPRhub".
- ^ "EBCDIC is incompatible with GDPR – Terence Eden's Blog".
External links[edit]
- Character Data Representation Architecture (CDRA) from IBM at the Wayback Machine (archived 2018-05-13). Contains IBM's official information on code pages and character sets.
- Host Code Page Reference from IBM, shows code charts for several single-byte EBCDIC pages.
- "Code Pages". from "IBM i globalization".
- ICU Converter Explorer Contains more information about EBCDIC derived from IBM's CDRA, including DBCS EBCDIC (Double Byte Character Set EBCDIC)
- ICU Charset Mapping Tables Contains computer readable Unicode mapping tables for EBCDIC and many other character sets
- EBCDIC character list, including decimal and hex values, symbolic name, and character/function
- EBCDIC-code pages with Latin-1-charset (JavaScript)
- All EBCDIC code pages and 3270 graphics escape codes at the Wayback Machine (archived August 27, 2016)