Signed overpunch explained

In computing, a signed overpunch is a coding scheme which stores the sign of a number by changing (usually) the last digit. It is used in character data on IBM mainframes by languages such as COBOL, PL/I, and RPG.[1] Its purpose is to save a character that would otherwise be used by the sign digit.[2] The code is derived from the Hollerith Punched Card Code, where both a digit and a sign can be entered in the same card column. It is called an overpunch because the digit in that column has a 12-punch or an 11-punch above it to indicate the sign. The top three rows of the card are called zone punches,[3] and so numeric character data which may contain overpunches is called zoned decimal.

In IBM terminology, the low-order four bits of a byte in storage are called the digit, and the high-order four bits are the zone.[4] The digit bits contain the numeric value 0–9. The zone bits contain either 'F'x, forming the characters 0–9, or the character position containing the overpunch contains a hexadecimal value indicating a positive or negative value, forming a different set of characters. (A, C, E, and F zones indicate positive values, B and D negative).

The PACK instruction on IBM System/360 architecture machines converts the sign of a zoned decimal number when converting to packed decimal,and the corresponding UNPK instruction will set the correct overpunched sign of its zoned decimal output.[5]

Language support

PL/I

PL/I uses the PICTURE attribute to declare zoned decimal data with a signed overpunch. Each character in a numeric picture except V, which indicates the position of the assumed decimal point, represents a digit. A picture character of T, I, or R indicates a digit position which may contain an overpunch. T indicates that the position will contain

Notes and References

  1. Book: IBM Corporation . RPG/400 Reference . June 1994 . 403 . Aug 7, 2018.
  2. Web site: Tech Talk, COBOL Tutorials, EBCDIC to ASCII Conversion of Signed Fields . 2008-03-15.
  3. Book: Van Overberghe, Jr. . Albert G. . Data Processing Technician Third Class . 1987 . Naval Education and Training Program . 3–8 . Jan 12, 2022.
  4. Book: IBM Corporation . IBM System/360 Principles of Operation . 34 . Jan 12, 2022.
  5. Book: IBM Corporation . z/Architecture Principles of Operation . Oct 2001 . 7-112,7-158 . 2nd . August 7, 2018.