Reducing Data Storage Space for Character Variables

One way to reduce data storage space, which also reduces I/O, is to reduce the length of character variables, potentially eliminating wasted space. Before discussing how to reduce the length of a character variable, consider how SAS assigns lengths to character variables.

Reducing the Length of Character Data with the LENGTH Statement

You can use a LENGTH statement to control the length of character variables.
General form, LENGTH statement for character variables:
LENGTH variable(s) $ length;
Here is an explanation of the syntax:
variable(s)
specifies the name of one or more SAS variables, separated by spaces.
length
is an integer from 1 to 32,767 that specifies the length of the variable(s).
Note: Make sure the LENGTH statement appears before any other reference to the variable in the DATA step. If the variable has been created by another statement, then a later use of the LENGTH statement does not change its length.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.86.18