SAS Formats under Windows |
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 |
specifies the width of the output field in bytes (not digits).
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 |
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
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
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.
data a; x = 9999999999999999999; y = put(x, IB8.); put y = hex16.; run;
SAS returns the hexadecimal representation of 2147483647
y=FFFFFFFFFFFFFF7F
See Also |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.