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
Required Arguments
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.
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 PIB
w.
d informat
and the IB
w.
d informat
give you different results, and you should differentiate carefully
between these two informats. The IB
w.
d informat
processes both positive and negative numbers and uses the high-order
bit as the sign bit. In contrast, the PIB
w.
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.