Previous Page | Next Page

SAS Formats under Windows

IBw.d Format: Windows



Writes values in integer binary (fixed-point) format.
Category numeric
Width range: 1-8
Default width: 4
Decimal range: 0-10
Alignment: left
Windows specifics: native floating-point representation
See: IBw.d in SAS Language Reference: Dictionary

Syntax
Details
Examples
Example 1: Processing a Positive Number
Example 2: Processing a Negative Number
Example 3: Processing a Number That Is Too Large to Format
See Also

Syntax

IBw.d

w

specifies the width of the output field in bytes (not digits).

d

specifies a scaling factor. When you specify a d value, the IBw.d format multiplies the number by 10d, and then applies the integer binary format to that value.


Details

The IBw.d format converts a double-precision number and writes it as an integer binary (fixed-point) value. Integers are stored in integer-binary (fixed-point) form.

For more information about microcomputer fixed-point values, see the Intel developer Web site.


Examples


Example 1: Processing a Positive Number

If you format 1.0 as the double-precision number, it is stored as an integer:

01 00 00 00 00 00 00 00

(Remember, Windows stores binary data in byte-reversed order.) The value written depends on the w value you specify.

If you specify the IB4. format, you receive the following value:

01 00 00 00

If you specify the IB2. format, you receive the following value:

01 00


Example 2: Processing a Negative Number

If you try to format -1 with the IB4. format, you receive the following value:

FF FF FF FF

If you specify the IB2. format, you receive the following value:

FF FF


Example 3: Processing a Number That Is Too Large to Format

When a numeric value is too large to format, the result is largest integer value that can be stored in four bytes, which is 2,147,483,647.

In the following code

data a;
   x = 9999999999999999999;
   y = put(x, IB8.);
   put y = hex16.;
run;

SAS returns the hexadecimal representation of 2147483647

 y=FFFFFFFFFFFFFF7F


See Also

Previous Page | Next Page | Top of Page