LENGTH Statement: Windows

Specifies the number of bytes SAS uses to store numeric variables.

Valid in: a DATA step
Windows specifics: Valid numeric variable lengths; valid values for length; valid values for n
See: LENGTH Statement in SAS Statements: Reference

Syntax

Optional Arguments

variable

specifies one or more variables that are to be assigned a length. This includes any variables in the DATA step, including those dropped from the output data set.

$

specifies that the preceding variables are character variables.

length

Under Windows, can range from 3 to 8 bytes for numeric variables.

DEFAULT=n

changes the default number of bytes used for storing the values of newly created numeric variables from 8 to the value of n. Under Windows, the value of n can range from 3 to 8 bytes.

Details

The LENGTH statement specifies the number of bytes SAS is to use for storing values of variables in each data set being created.
CAUTION:
Any length less than 8 bytes can result in a loss of precision for the value of the variable.