Jump to content

EBCDIC

From Alfawiki
Extended Binary Coded Decimal Interchange Code (EBCDIC)
Company typeCharacter encoding standard
IndustryComputing
Founded1963–1964
FounderIBM
ProductsCharacter encoding for IBM mainframe and midrange computer operating systems

Extended Binary Coded Decimal Interchange Code (EBCDIC; ) is an eight-bit character encoding predominantly utilized on IBM mainframe and IBM midrange computer operating systems. Its origins trace back to coding schemes associated with punched cards and the six-bit binary-coded decimal code used by IBM's computer peripheral devices during the late 1950s and early 1960s. Beyond IBM platforms, EBCDIC is also implemented on systems such as Fujitsu-Siemens' BS2000/OSD, OS-IV, MSP, MSP-EX, the SDS Sigma series, Unisys VS/9, Unisys MCP, and ICL VME.

History

EBCDIC was created by IBM between 1963 and 1964 and launched alongside the IBM System/360 mainframe series. This eight-bit encoding method was developed independently from the seven-bit ASCII standard, designed to extend IBM's earlier Binary-Coded Decimal Interchange Code (BCDIC), which encoded punched card zone and digit punches efficiently within six bits. The encoding maintained distinctions such as between uppercase 'S' and lowercase 's' to preserve the integrity of punched card data.

While IBM endorsed ASCII standardization, the lack of readily available ASCII peripherals for the System/360 prompted the adoption of EBCDIC. The commercial triumph of the System/360, along with compatible machines like the RCA Spectra 70, ICL System 4, and Fujitsu FACOM, contributed to EBCDIC’s broad acceptance.

All IBM mainframe operating systems and the IBM i OS for midrange computers natively employ EBCDIC but also support interoperability with ASCII; for instance, ISPF in z/OS can process both encodings. Modern IBM Z mainframes incorporate hardware acceleration to facilitate character set conversions. Current z/OS C and C++ compilers provide POSIX environment support that defaults to ASCII.

Conversely, certain IBM hardware operating systems—such as IBM AIX, Linux on IBM Z, and Linux on Power—utilize ASCII encoding, as do all platforms running on the IBM Personal Computer and its successors.

Compatibility with ASCII

Developing software that functions correctly with both ASCII and EBCDIC has presented considerable difficulties:

  • Simple programs designed for ASCII, like code printing letters A through Z, output 41 characters under EBCDIC due to unassigned codes.
  • In EBCDIC, lowercase letters precede uppercase ones, and letters come before numbers in sorting order—contrasting with ASCII’s arrangement.
  • Numerous programming languages, file formats, and network protocols originally crafted for ASCII rely on punctuation marks (such as caret , tilde , square brackets, curly braces) that are missing from EBCDIC, complicating direct translation. Solutions like trigraphs were introduced to address this. Conversely, EBCDIC contains unique symbols such as (logical not) and (US cent) used in IBM environments without ASCII counterparts; for example, the logical not character appears in IBM languages like PL/I.
  • The EBCDIC NL (next line) character is most appropriately mapped to ASCII LF; however, inconsistencies arise because EBCDIC also defines a separate LF character.
  • Seven-bit ASCII leaves the high bit unused in an eight-bit byte, often exploited by software to store extra information. On platforms like the PDP-11, bytes with this high bit set were interpreted as negative values—a behavior inherited by the C language—leading to complications when transitioning to 8-bit EBCDIC or extended ASCII encodings.

Code page configuration

Across the globe, there are numerous EBCDIC code pages designed to accommodate diverse writing systems, including Chinese, Japanese (such as EBCDIC 930, JEF, KEIS), Korean, and Greek (EBCDIC 875). Many of these variations rearrange alphabetic characters without an obvious pattern.

The following table displays the "invariant subset"—a collection of characters consistently positioned in all EBCDIC code pages utilizing the Latin alphabet. This set encompasses nearly all characters from the ISO/IEC 646 invariant repertoire, with the exception of the exclamation mark. Cells shaded in gray denote punctuation marks absent in both ASCII and EBCDIC as defined by Code Page 37, which is a widely used variant. Empty cells are typically regionally assigned, whereas characters marked in gray are frequently substituted or altered. Similar to ASCII, this subset predominantly supports languages employing the ISO basic Latin alphabet, including English.

... [Table continues as original] ... }

Explanation of non-ASCII EBCDIC control characters

The following section outlines EBCDIC control codes that either lack direct equivalents among ASCII control characters or serve additional functions. When mapped to Unicode, most correspond to C1 control codepoints as specified by IBM’s Character Data Representation Architecture (CDRA).

The standard New Line (NL) control corresponds to ISO/IEC 6429’s Next Line (NEL, U+0085). However, many other C1-mapped controls diverge from the ISO/IEC 6429 C1 set and other recognized C1 sets like ISO 6630. As a result, non-ASCII EBCDIC controls form a distinct C1 group, although they do not have an officially assigned escape sequence under ISO/IEC 2022 or ISO/IEC 10646 (Unicode).

Apart from U+0085, Unicode does not prescribe specific interpretations for these C1 controls; their use is left to higher-level protocols that may optionally apply ISO/IEC 6429 semantics.

Mnemonic EBCDIC CDRA pairing Name Description
SEL 04 009C Select Device control accepting a single-byte parameter.
PF Punch Off Documented in GOST 19768-93.
RNL 06 0086 Required New Line Resets Template:Control code link mode.
LC Lower Case Listed in GOST 19768-93.
GE 08 0097 Graphic Escape Non-locking shift altering interpretation of the next character (e.g., Code page 310). Comparable to ISO/IEC 6429’s Template:Control code link (008E).
SPS 09 008D Superscript Initiates superscript or cancels subscript. See ISO/IEC 6429’s Template:Control code link (008C).
RPT 0A 008E Repeat Activates print buffer repeat mode.
SMM Start of Manual Message Recorded in GOST 19768-93.
RES/ENP 14 009D Restore, Enable Presentation Resumes output after Template:Control code link.
NL 15 0085 (000A) New Line Line break; default mapping aligns with ISO/IEC 6429’s Template:Control code link. Occasionally exchanged with Line Feed (EBCDIC 0x25) following UNIX practices.
POC 17 0087 Program Operator Communication Followed by two operators specifying particular functions such as lights or keys. Distinct from ISO/IEC 6429’s Template:Control code link (009B), Template:Control code link (009D), and Template:Control code link (009F).
IL Idle Noted in GOST 19768-93.
UBS 1A 0092 Unit Backspace Performs fractional backspace.
CC Cursor Control Mentioned in GOST 19768-93.
CU1 1B 008F Customer Use One Reserved for customer-defined purposes; not utilized by IBM.
IUS/ITB 1F 001F Interchange Unit Separator / Intermediate Transmission Block Separates data units or marks termination of intermediate transmission blocks.
DS 20 0080 Digit Select Applied in S/360 CPU edit (ED) instruction.
SOS 21 0081 Start of Significance Utilized in S/360 CPU edit (ED). Distinguished from ISO/IEC SOS by IBM’s notation SOS. with a period.
FS, FDS 22 0082 Field Separator Employed in S/360 CPU edit (ED). Differs from ASCII File Separator at hexadecimal value 0x1C.
WUS 23 0083 Word Underscore Applies underscores preceding words; contrasts with ISO/IEC SGR parameters.
BYP/INP 24 0084 Bypass, Inhibit Presentation Disables output except for transmission control codes and RES/ENP until subsequent RES/ENP occurs.
SA 28 0088 Set Attribute Initiates fixed-length device-specific control sequences; now deprecated in favor of Template:Control code link.
SFE 29 0089 Start Field Extended Begins variable-length device-specific control sequences; replaced by CSP.
SM/SW 2A 008A Set Mode, Switch Device-specific mode adjustments such as buffer switching.
CU2 2B 008B Customer Use Two Appears in certain specifications like GOST; newer IBM documents list only CU1 and CU3 for customer use and assign this position to CSP.
CSP Control Sequence Prefix Marks the beginning of variable-length device-specific control sequences containing class, count, type, and parameter bytes. Differs from ISO/IEC DCS (0090) and CSI (009B).
MFA 2C 008C Modify Field Attribute Starts variable-length device-specific control sequences; superseded by CSP.
IR 33 | data-sort-value="147"|0093 | Index Return | Moves cursor to the beginning of the next line or concludes an information unit
PP 34 | data-sort-value="148" rowspan=2 |0094 | Presentation Position | Followed by two parameters indicating function and position; distinct from ISO/IEC CUP and HVP sequences
PN Documented within GOST 19768-93
TRN 35 | data-sort-value="149" rowspan=2 |0095 | Transparent | Followed by a byte specifying the count of transparent bytes
RST Recorded in GOST 19768-93
NBS 36 | data-sort-value="150" rowspan=2 |0096 | Numeric Backspace | Moves cursor backward by one digit width
UC Listed under GOST 19768-93
SBS 38 | data-sort-value="152"|0098 | Subscript | Starts subscript or cancels superscript; compare with ISO/IEC PLD (008B)
IT 39 | data-sort-value="153"|0099 | Indent Tab | Indents current and subsequent lines until encountering RNL or RFF
RFF 3A | data-sort-value="154"|009A | Required Form Feed | Page break that resets Indent Tab mode
CU3 3B | data-sort-value="155"|009B | Customer Use Three | Intended for customer use; not employed by IBM
EO FF | data-sort-value="159" |009F | Eight Ones | Filler character composed entirely of ones bits


Code pages featuring Latin-1 character sets

The code pages listed below encompass the complete Latin-1 character set (ISO/IEC 8859-1). The first column indicates the original code page number, while the second column displays the euro-updated code page where the generic currency sign (¤) is replaced by the euro sign (€), or, in the case of EBCDIC 924, modified to align with ISO 8859-15.

These code pages vary by country since they initially originated as nation-specific character repertoires and were subsequently extended to include the entire ISO 8859-1 range. Consequently, a particular ISO 8859-1 character might have different code point assignments depending on the code page, referred to as Country Extended Code Pages (CECPs).

CCSID Euro
revision
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

Eric S. Raymond, a proponent of Open-source software, characterized EBCDIC as a character encoding largely unpopular among developers. According to the Jargon File, EBCDIC is an IBM character set with numerous incompatible variants, non-sequential letter ordering, and lacks certain ASCII punctuation marks essential for contemporary programming languages. Originating in the early 1960s from punched card encoding, EBCDIC was perceived as a strategy by IBM to maintain customer lock-in in opposition to the ASCII standard. Although IBM currently supports open systems, it continues to restrict full disclosure of its extensive EBCDIC variant documentation. Within hacker communities, EBCDIC often carries a negative reputation.

EBCDIC's peculiarities have inspired humor in technical circles. For instance, a Unix fortune from 4.3BSD Reno jokingly associated EBCDIC with a failed government encryption initiative.

This character set has also appeared in popular media; notably, in the 1979 adventure game series Zork, EBCDIC is used to represent an unintelligible language in Zork II.

In practical business scenarios, EBCDIC's shortcomings became apparent in a high-profile incident: in 2019, a Belgian financial institution employing EBCDIC internally was unable to correctly handle a customer's surname containing an umlaut. The customer exercised their rights under the General Data Protection Regulation to request correction of inaccurate personal data. The bank contended that its system did not support diacritics or lowercase letters due to limitations inherent in EBCDIC. Ultimately, the appeals court ruled in favor of the customer, emphasizing EBCDIC's incompatibility with contemporary data management requirements.

See also

External links