EBCDIC encoding family | |
Classification: | 8-bit basic Latin encodings (non‑ASCII) |
Prev: | BCD |
Extended Binary Coded Decimal Interchange Code[1] (EBCDIC;) 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. 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.
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.[2]
While IBM was a chief proponent of the ASCII standardization committee, 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. 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's mainframe operating systems, and its IBM i operating system for midrange computers, use EBCDIC as their inherent encoding (with toleration for ASCII, for example, ISPF in z/OS can browse and edit both EBCDIC and ASCII encoded files). Software 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 operating systems running on IBM hardware use EBCDIC; IBM AIX, Linux on IBM Z, and Linux on Power all use ASCII, as do all operating systems that run on the IBM Personal Computer and its successors.
There were numerous difficulties to writing software that would work in both ASCII and EBCDIC.
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"[5] 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. Like ASCII, the invariant subset works only for languages using the ISO basic Latin alphabet, such as English (excluding loanwords and some uncommon orthographic variations) and Dutch (if the "ij" and "IJ" ligatures are written as two characters).
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).[6] [7]
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),[8] 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.[9] 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, 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)).
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),[10] so this mapping is permissible in, but not specified by, Unicode.
Mnemonic | EBCDIC | CDRA pairing | Name | Description | |||
---|---|---|---|---|---|---|---|
SEL | data-sort-value="4" rowspan=2 | 04 | data-sort-value="156" rowspan=2 | 009C | Select | Device control character taking a single-byte parameter. | |
PF | Punch Off | Listed in this location by GOST 19768-93. | |||||
RNL | data-sort-value="6" rowspan=2 | 06 | data-sort-value="134" rowspan=2 | 0086 | Required New Line | Line-break resetting mode | |
LC | Lower Case | Listed in this location by GOST 19768-93. | |||||
GE | data-sort-value="8" | 08 | data-sort-value="151" | 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 (008E). | |
SPS | data-sort-value="9" | 09 | data-sort-value="141" | 008D | Superscript | Begin superscript or undo subscript. Compare ISO/IEC 6429's (008C). | |
RPT | data-sort-value="10" rowspan=2 | 0A | data-sort-value="142" rowspan=2 | 008E | Repeat | Switch to an operation mode repeating a print buffer | |
SMM | Start of Manual Message | Listed in this location by GOST 19768-93. | |||||
RES/ENP | data-sort-value="20" | 14 | data-sort-value="157" | 009D | Restore, Enable Presentation | Resume output (after) | |
NL | data-sort-value="21" | 15 | data-sort-value="133" | 0085 (000A) | Line break. Default mapping (0085) matches ISO/IEC 6429's . Mappings sometimes swapped with Line Feed (EBCDIC 0x25) in accordance with UNIX line breaking convention. | ||
POC | data-sort-value="23" rowspan=2 | 17 | data-sort-value="135" rowspan=2 | 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 (009B), (009D) and (009F). | |
IL | Idle | Listed in this location by GOST 19768-93. | |||||
UBS | data-sort-value="26" rowspan=2 | 1A | data-sort-value="146" rowspan=2 | 0092 | Unit Backspace | A fractional backspace. | |
CC | Cursor Control | Listed in this location by GOST 19768-93. | |||||
CU1 | data-sort-value="27" | 1B | data-sort-value="143" | 008F | Customer Use One | Not used by IBM; for customer use. | |
IUS/ITB | data-sort-value="31" | 1F | data-sort-value="31" | 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), or used as a transmission control code to delimit the end of an intermediate block. | |
DS | data-sort-value="32" | 20 | data-sort-value="128" | 0080 | Digit Select | Used by S/360 CPU edit (ED) instruction | |
SOS | data-sort-value="33" | 21 | data-sort-value="129" | 0081 | Start of Significance | Used by S/360 CPU edit (ED) instruction. (Note: different from ISO/IEC 6429's ; where distinguishing them is necessary, IBM abbreviates Start of Significance as (with a dot) and Start of String as, otherwise they are abbreviated the same.)[11] | |
FS, FDS | data-sort-value="34" | 22 | data-sort-value="130" | 0082 | Field Separator | Used by S/360 CPU edit (ED) instruction. (Note:, as abbreviated FS in ASCII, is at 0x1C and abbreviated IFS.) | |
WUS | data-sort-value="35" | 23 | data-sort-value="131" | 0083 | Word Underscore | Underscores the immediately preceding word. Contrast with ISO/IEC 6429's SGR. | |
BYP/INP | data-sort-value="36" | 24 | data-sort-value="132" | 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 . | |
SA | data-sort-value="40" | 28 | data-sort-value="136" | 0088 | Set Attribute | Marks the beginning of a fixed-length device specific control sequence. Deprecated in favour of . | |
SFE | data-sort-value="41" | 29 | data-sort-value="137" | 0089 | Start Field Extended | Marks the beginning of a variable-length device specific control sequence. Deprecated in favour of . | |
SM/SW | data-sort-value="42" | 2A | data-sort-value="138" | 008A | Set Mode, Switch | Device specific control that sets a mode of operation, such as a buffer switch. | |
CU2 | data-sort-value="43" rowspan=2 | 2B | data-sort-value="139" rowspan=2 | 008B | Customer Use Two | This appears in some specifications, such as GOST 19768-93;[12] newer IBM specifications for EBCDIC control codes list only CU1 and CU3 as customer-use, and use this position for . | |
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 (0090) and (009B). | |||||
MFA | data-sort-value="44" | 2C | data-sort-value="140" | 008C | Modify Field Attribute | Marks the beginning of a variable-length device specific control sequence. Deprecated in favour of . | |
data-sort-value="48" | 30 | data-sort-value="144" | 0090 | (reserved) | Reserved for future use by IBM | ||
data-sort-value="49" | 31 | data-sort-value="145" | 0091 | (reserved) | Reserved for future use by IBM | ||
IR | data-sort-value="51" | 33 | data-sort-value="147" | 0093 | Index Return | Either move to start of next line (see also), or terminate an information unit (see also). | |
PP | data-sort-value="52" rowspan=2 | 34 | data-sort-value="148" rowspan=2 | 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. | |||||
TRN | data-sort-value="53" rowspan=2 | 35 | data-sort-value="149" rowspan=2 | 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. | |||||
NBS | data-sort-value="54" rowspan=2 | 36 | data-sort-value="150" rowspan=2 | 0096 | Numeric Backspace | Move backward the width of one digit. | |
UC | Upper Case | Listed in this location by GOST 19768-93. | |||||
SBS | data-sort-value="56" | 38 | data-sort-value="152" | 0098 | Subscript | Begin subscript or undo superscript. Compare ISO/IEC 6429's (008B). | |
IT | data-sort-value="57" | 39 | data-sort-value="153" | 0099 | Indent Tab | Indents the current and all following lines, until or is encountered. | |
RFF | data-sort-value="58" | 3A | data-sort-value="154" | 009A | Required Form Feed | Page-break resetting mode. | |
CU3 | data-sort-value="59" | 3B | data-sort-value="155" | 009B | Customer Use Three | Not used by IBM; for customer use. | |
data-sort-value="62" | 3E | data-sort-value="158" | 009E | (reserved) | Reserved for future use by IBM | ||
EO | data-sort-value="255" | FF | data-sort-value="159" | 009F | All ones character used as filler |
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)
Different countries have different code pages because these code pages originated as code pages with country-specific character repertoires, and were later expanded to contain the entire ISO 8859-1 repertoire, meaning that a given ISO 8859-1 character may have different code point values in different code pages. They are known as Country Extended Code Pages (CECPs).[13]
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) |
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[14] members of a subculture of enthusiastic programmers. The Jargon File 4.4.7 gives the following definition:
EBCDIC design was also the source of many jokes. One such joke, found in the Unix fortune file of 4.3BSD Reno (1990) went:
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:
In 2021, it became public that a Belgian bank was still using EBCDIC internally in 2019. A customer insisted that the correct spelling of his surname included an umlaut, which the bank omitted, and 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's argument included the fact that their system used EBCDIC, as well as that it did not support letters with diacritics (or lower case, for that matter). The appeals court ruled in favor of the customer.[15] [16]