Code page 37

Code page 37 (CCSID 37; label ), known as "USA/Canada - CECP", is an EBCDIC code page used on IBM mainframes. It encodes the ISO/IEC 8859-1 repertoire of graphic characters.

Code page 37 is one of the most-used and best-supported EBCDIC code pages. It is used as the default z/OS code page in the United States and other English speaking countries. It is considered the "required" EBCDIC code page for the United States, and also used in Australia, New Zealand, the Netherlands, Portugal and Brazil, and on ESA/390 systems in Canada, but not on Canadian AS/400 systems, which use Code page 500 instead. It is one of four EBCDIC code pages (alongside 500, 875 and 1026) with mapping data supplied by Microsoft to the Unicode Consortium, and one of seven (alongside 273, 424, 500, 875, 1026 and 1140) supported by Python as standard.

Character set

{{chset-cell1

|style=background:#DDD}}

{{chset-cell1

|style=background:#DDD}}

Code page translation

Since CP 037 contains all of the standard Latin-1 characters, it is possible to translate the character codes from the CP 037 charset to ISO 8859-1 character codes, so that translation back to the CP 037 charset is an exact value-preserving round-trip conversion. Likewise, half of the control character codes can be translated into their exact ASCII equivalents. If the remaining EBCDIC-only control characters are translated (arbitrarily) into the remaining unused ASCII codes points (hex 80 to 9F) as well, the resulting translation covers all of the 256 character code points. Such a translation table is shown below:

{| class="wikitable chset nounderlines" frame="box" width="50%" style="text-align:center; font-family:monospace; border-collapse:collaps; background:#FFFFEF"

|- |colspan="17"| CP 037 → ISO 8859-1 |- bgcolor=#EFF3FF |bgcolor=#BFBFBF| ||_0||_1||_2||_3||_4||_5||_6||_7||_8||_9||_A||_B||_C||_D||_E||_F |- |bgcolor=#EFF3FF|0_||00||01||02||03||bgcolor=#E7E7E7|9C||09||bgcolor=#E7E7E7|86||7F||bgcolor=#E7E7E7|97||bgcolor=#E7E7E7|8D||bgcolor=#E7E7E7|8E||0B||0C||0D||0E||0F |- |bgcolor=#EFF3FF|1_||10||11||12||13||bgcolor=#E7E7E7|9D||85||08||bgcolor=#E7E7E7|87||18||19||bgcolor=#E7E7E7|92||bgcolor=#E7E7E7|8F||1C||1D||1E||1F |- |bgcolor=#EFF3FF|2_||bgcolor=#E7E7E7|80||bgcolor=#E7E7E7|81||bgcolor=#E7E7E7|82||bgcolor=#E7E7E7|83||bgcolor=#E7E7E7|84||0A||17||1B||bgcolor=#E7E7E7|88||bgcolor=#E7E7E7|89||bgcolor=#E7E7E7|8A||bgcolor=#E7E7E7|8B||bgcolor=#E7E7E7|8C||05||06||07 |- |bgcolor=#EFF3FF|3_||bgcolor=#E7E7E7|90||bgcolor=#E7E7E7|91||16||bgcolor=#E7E7E7|93||bgcolor=#E7E7E7|94||bgcolor=#E7E7E7|95||bgcolor=#E7E7E7|96||04||bgcolor=#E7E7E7|98||bgcolor=#E7E7E7|99||bgcolor=#E7E7E7|9A||bgcolor=#E7E7E7|9B||14||15||bgcolor=#E7E7E7|9E||1A |- |bgcolor=#EFF3FF|4_||20||A0||E2||E4||E0||E1||E3||E5||E7||F1||A2||2E||3C||28||2B||7C |- |bgcolor=#EFF3FF|5_||26||E9||EA||EB||E8||ED||EE||EF||EC||DF||21||24||2A||29||3B||AC |- |bgcolor=#EFF3FF|6_||2D||2F||C2||C4||C0||C1||C3||C5||C7||D1||A6||2C||25||5F||3E||3F |- |bgcolor=#EFF3FF|7_||F8||C9||CA||CB||C8||CD||CE||CF||CC||60||3A||23||40||27||3D||22 |- |bgcolor=#EFF3FF|8_||D8||61||62||63||64||65||66||67||68||69||AB||BB||F0||FD||FE||B1 |- |bgcolor=#EFF3FF|9_||B0||6A||6B||6C||6D||6E||6F||70||71||72||AA||BA||E6||B8||C6||A4 |- |bgcolor=#EFF3FF|A_||B5||7E||73||74||75||76||77||78||79||7A||A1||BF||D0||DD||DE||AE |- |bgcolor=#EFF3FF|B_||5E||A3||A5||B7||A9||A7||B6||BC||BD||BE||5B||5D||AF||A8||B4||D7 |- |bgcolor=#EFF3FF|C_||7B||41||42||43||44||45||46||47||48||49||AD||F4||F6||F2||F3||F5 |- |bgcolor=#EFF3FF|D_||7D||4A||4B||4C||4D||4E||4F||50||51||52||B9||FB||FC||F9||FA||FF |- |bgcolor=#EFF3FF|E_||5C||F7||53||54||55||56||57||58||59||5A||B2||D4||D6||D2||D3||D5 |- |bgcolor=#EFF3FF|F_||30||31||32||33||34||35||36||37||38||39||B3||DB||DC||D9||DA||bgcolor=#E7E7E7|9F |}

Variants and relation to other code pages

The positions of the caret () and not sign (), while officially B0hex and 5Fhex respectively, are sometimes switched, including when used with APL on the 3279 system. This variant has been acknowledged by SHARE, but not officially designated as a code page by IBM, and is sometimes referred to as code page 37-2 by transcoding software.

Several other code pages exist, which amount to code page 37 with a few characters swapped. In particular, code page 37 encodes the hard brackets () at BA and BB, while other variants use other encodings for the hard brackets. For example, code page 1047 is a variant used by the MVS Open Systems compiler. It differs from code page 37 in six positions: and switch places, as do and , placing the hard brackets at AD and BD; the caret and not sign also switch places, like in code page 37-2. This encoding of the brackets was inherited from the 3270 display system. Although IBM intends code page 1047 to be used to fulfil specific requirements only, and not as a replacement for code pages 37 and 500, the subset of code page 1047 encoding the ASCII repertoire was used for the single-byte graphical codes in UTF-EBCDIC.

Code page 500, known as "International EBCDIC", "International Latin-1" or "International Number 5", is the other major EBCDIC encoding for the ISO/IEC 8859-1 repertoire. It is used in Belgium, Switzerland and on AS/400 systems in Canada. It is related to code page 37 and has the same repertoire, but differs in seven positions; in particular, it encodes and at 4A and 5A respectively, which are used for the cent sign () and exclamation point () in code page 37. The caret () is also encoded at 5F, similarly to code page 37-2 and 1047. The is encoded at B0, the at BA, the at 4F and the pipe character (|) at BB. Code page 500 is in turn related to the German code page 273, which swaps several character pairs in a manner corresponding to the differences between DRV8 and ISO/IEC 8859-1, resulting in placement of the hard brackets at 63 and FC.

A variant of code page 37 with the euro sign () character added at the 9Fhex position, replacing the universal currency sign () is code page 1140. Similarly, code page 1148 makes the same change to code page 500, and code page 1141 does so to code page 273.

An EBCDIC code page with the ISO/IEC 8859-15 repertoire, including the euro sign, is code page 924; this is related to code page 1047 but with the ISO/IEC 8859-1 characters replaced with their ISO/IEC 8859-15 replacements, with ¢ and ¬ moved to their code page 500 locations at B0hex and BAhex respectively, and with Ý moved to 4Ahex.

See also

  • EBCDIC