SAS Companion for the OS/2 Environment

# Numeric Variables

Significant Digits and Largest Integer by Length for SAS Variables under OS/2
Length
in Bytes
Largest Integer
Represented Exactly
Exponential
Notation
3 8,192 213
4 2,097,152 221
5 536,870,912 229
6 137,438,953,472 237
7 35,184,372,088,832 245
8 9,007,199,254,740,992 253

Suppose you know that a numeric variable always has values between 0 and 100, you can use a length of 3 to store the number and thus save space in your data set. The following is an example:

```data mydata;
length num 3;
`more data lines`
run;```

Note:   Dummy variables (those whose only purpose is to hold 0 or 1) can be stored in a variable whose length is 3 bytes.

CAUTION:
Use the 3-byte limit for only those variables whose values are small, preferably integers. If the value of a variable becomes large or has many significant digits, you may lose precision when saving the results of arithmetic calculations if the length of a variable is less than 8 bytes.