Chapter Contents

Previous

Next
COMPRESS=

COMPRESS=



Controls the compression of observations in output SAS data sets

Valid in: configuration file, SAS invocation, OPTIONS statement, Systems Options window
Category: Files: SAS files
PROC OPTIONS GROUP= SASFILES


Syntax
Syntax Description
Details
Comparisons
See Also

Syntax

COMPRESS=YES | NO | CHAR | BINARY

Syntax Description

YES | CHAR
specifies that observations in a newly created SAS output data set are compressed (variable-length records).
Tip: SAS uses RLE (Run Length Encoding) to compress observations. This compression algorithm (RLE) is better for character data.
Alias: Y

Note:   COMPRESS=CHAR is accepted by Version 7 and later versions of SAS software.  [cautionend]

NO
specifies that observations in a newly created SAS output data set are uncompressed (fixed-length records).
Alias: N

BINARY
specifies that observations in a newly created SAS output data set are compressed.
Tip: SAS uses RDC (Ross Data Compression) for this setting. This method is highly effective for compressing medium to large (several hundred bytes or larger) blocks of binary data (that is, numeric variables). Because the compression function operates on a single record at a time, the record length needs to be several hundred bytes or larger for effective compression.

Note:   COMPRESS=BINARY is accepted by Version 7 and later versions of SAS software.  [cautionend]

Operating Environment Information:   The syntax that is shown here applies to the OPTIONS statement. On the command line or in a configuration file, the syntax is specific to your operating environment. For details, see the SAS documentation for your operating environment.  [cautionend]


Details

When COMPRESS=YES or COMPRESS=CHAR, SAS compresses the size of the data set with run-length encoding. Run-length encoding compresses the data set by reducing repeated consecutive characters to two- or three-byte representations.

When COMPRESS=BINARY, SAS uses Ross Data Compression, which combines run-length encoding and sliding-window compression to compress the data set.

Use SAS/Toolkit software to specify your own compression method.

Note:   Compression of observations is not supported by all engines.   [cautionend]

In Version 8, data sets created with engines that were available in earlier versions of SAS, such as the TAPE and XPORT engines, are still accessed by those engines. Therefore, if compression was unable for those engines, it is also not available when you access those data sets in Version 8.

The advantages that are gained by using the COMPRESS= system option include:

The disadvantages of using the COMPRESS= system option are that


Comparisons

The COMPRESS= system option can be overridden by the COMPRESS= data set option.

PERFORMANCE NOTE: Using this option increases the CPU time for reading a data set because of the overhead of uncompressing the record. In addition, some engines do not support compression of observations. When using COMPRESS=YES and REUSE=YES system option settings, observations cannot be addressed by observation number. For additional details, see the COMPRESS= data set option in "SAS Data Set Options."

Note that REUSE=YES takes precedence over the POINTOBS=YES data set option setting.

See Also

Data Set Options:

COMPRESS=
REUSE=

System Option:

REUSE=


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.