Binary-Decimal Format

Binary-decimal format means that the sign (positive or negative) is in the leftmost bit of the field and the numeric value is in the remaining bits of the field. Positive numbers have a zero in the sign bit; negative numbers have a one in the sign bit and are in twos complement form. A binary field can be from one to nine digits in length and can be defined with decimal positions. If the length of the field is from one to four digits, the compiler assumes a binary field length of 2 bytes. If the length of the field is from five to nine digits, the compiler assumes a binary field length of 4 bytes.

An item with binary-decimal format can only hold a limited range of values. For example, a two-byte binary field with two digits and zero decimal positions can hold values between -99 and 99.

Note: The integer and unsigned integer data types are also in binary format, but they can hold the full range of values. A two-byte integer field can hold values between -32768 and 32767. A two-byte unsigned integer field can hold values between 0 and 65535.