IBw.d Informat: Windows

Reads integer binary (fixed-point) values.

Category: Numeric
Windows specifics: native floating-point representation
See: IBw.d Informat in SAS Formats and Informats: Reference

Syntax

IBw.d

Required Arguments

w

specifies the width of the input field.

Default 4
Range 1–8

d

specifies the power of 10 by which to divide the input value. SAS uses the d value even if the input data contain decimal points.

Range 0–10

Details

For integer binary data, the high-order bit is the value's sign: 0 for positive values, 1 for negative. Negative values are represented in twos-complement notation. If the informat includes a d value, the data value is divided by 10d.
Using the IBw.d informat requires you to understand twos complements and byte-swapped data format.
For more information about microcomputer fixed-point values, see Intel developer website.

Comparisons

The IBw.d informat and the PIBw.d informat give you different results. The IBw.d informat processes both positive and negative numbers and it uses the high-order bit as the sign bit. In contrast, the PIBw.d informat is used only for positive numbers and it does not look for a sign bit. For example, suppose your data contain the following two-byte (byte-swapped) value:
01 80
When you read this value using the IB2. informat, the informat looks for the sign bit, sees that it is on, and reads the value as −32,767. However, if you read this value with the PIB2. informat, no sign bit is used, and the result is 32,769.

Example

Suppose that your data contain the following 6-byte (byte-swapped) value:
64 00 00 00 00 00
If you read this value using the IB6. informat, it is read as the fixed-point value 100.0. Now suppose that your data contain the following (byte-swapped) value:
01 80
Because the sign bit is set, the value is read as −32,767.