PIBw.d Informat: Windows

Reads positive integer-binary (fixed-point) values.

Category: Numeric
Windows specifics: native byte-swapped integers
See: PIBw.d Informat in SAS Formats and Informats: Reference

Syntax

PIBw.d

Required Arguments

w

specifies the width of the input field.

Default 1
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

Positive integer binary values are the same as integer binary (see the informat IBw.d Informat: Windows ), except that all values are treated as positive. Thus, the high-order bit is part of the value rather than the value's sign.

Comparisons

The PIBw.d informat and the IBw.d informat give you different results, and you should differentiate carefully between these two informats. The IBw.d informat processes both positive and negative numbers and 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 your data contain the following one-byte value:
FF
If you read this value using the PIB1. informat, it is read as the double-precision value 255.0. Using this informat requires you to understand twos complements and byte-swapped data format.