 SAS Informats under Windows

IBw.d Informat: Windows

 Category numeric Width range: 1-8 Default width: 4 Decimal range: 0-10 Windows specifics: native floating-point representation See: IBw.d Informat in SAS Language Reference: Dictionary

Syntax

 IBw.d

w

specifies the width of the input field.

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.

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.

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. As an 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.

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. Previous Page | Next Page | Top of Page