Chapter Contents

Previous

Next
IBRw.d

IBRw.d



Reads integer binary (fixed-point) values in Intel and DEC formats

Category: Numeric


Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

IBRw.d

Syntax Description

w
specifies the width of the input field.
Default: 4
Range: 1-8

d
optionally specifies the power of 10 by which to divide the value.
Range: 0-10


Details

The IBRw.d informat reads integer binary (fixed-point) values, including negative values that are represented in two's complement notation. IBRw.d reads integer binary values that are generated by and for Intel and DEC platforms. Use IBRw.d to read integer binary data from Intel or DEC environments in other operating environments. The IBRw.d informat in SAS code allows for a portable implementation for reading the data in any operating environment.

Note:   Different operating environments store integer binary values in different ways. This concept is called byte ordering. For a detailed discussion about byte ordering, see Byte Ordering on Big Endian and Little Endian Platforms.   [cautionend]


Comparisons

The IBw.d and PIBw.d informats are used to read native format integers. (Native format allows you to read and write values that are created in the same operating environment.) The IBRw.d and PIBRw.d informats are used to read little endian integers in any operating environment.

On Intel and DEC operating environments, the IBw.d and IBRw.d informats are equivalent.

To view a table that shows the type of informat to use with big endian and little endian integers, see SAS Informats and Byte Ordering.

To view a table that compares integer binary notation in several programming languages, see Integer Binary Notation and Programming Languages.


Examples

You can use the INPUT statement and specify the IBR informat. However, in these examples we use the informat with the INPUT function, where binary input values are described using a hex literal.

x=input('0100'x,ibr2.);
y=input('0001'x,ibr2.);



SAS Statements
Results on BigEndian Platforms Results on LittleEndian Platforms
put x=;
put y=;
1
256
1
256


See Also

Informat:

IBw.d


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.