Hexadecimal
A way of writing numbers in base 16, used everywhere on the mainframe to show the exact contents of bytes.
Also written hex, HEX ON, base 16
Hexadecimal, or hex, is a way of writing numbers in base 16. It uses the digits 0 to 9 and then the letters A to F for the values 10 to 15. One hex digit stands for four bits, so every byte can be written as exactly two hex digits, from 00 to FF.
Mainframe people use hex to show the exact contents of storage. Abend codes are hex, which is why one is called S0C7 and not S199. Dumps show memory in hex. In documentation, a value written as X'F1' means the byte with the hex value F1, which in EBCDIC is the character 1.
In the ISPF editor or browse, the HEX ON command shows each line twice: once as characters, and below it the hex value of each byte in two rows. This is how you find characters you cannot see, such as low values, and how you check packed decimal and binary fields, which look like nonsense as text.
Reading hex takes a little practice. Learning that F0 to F9 are the digits, 40 is a space and 00 is low values covers most of what you will need at first.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- EBCDICThe character encoding mainframes use, where letters and numbers are stored as different byte values than on a laptop.
- Packed decimalA compact way of storing numbers, two digits per byte, used heavily for amounts in business records.
- DumpA copy of a program's memory taken at the moment it failed, used to find out why.
- Binary fieldA COBOL number stored as a binary integer, written with USAGE COMP, COMP-4, BINARY or COMP-5.
- AbendAn abnormal end: a program stopping in an uncontrolled way rather than finishing and reporting a result.
- Zoned decimalThe default way COBOL stores numbers: one digit per byte, readable as text, with the sign hidden in the last byte.