Chapter Contents

Previous

Next

Compressed Data Files

You can compress data files to save space. When you create a compressed data file, SAS writes a note to the log indicating the percentage reduction that is obtained by compressing the data file. The compression percentage is obtained by comparing the size of the compressed data set with the size of a noncompressed data file of the same page size and record count. Note that compression may not result in a smaller data file.

To compress SAS data files, use the COMPRESS= data set option or the COMPRESS= system option. When you specify COMPRESS=YES, SAS uses the default compression algorithm. You can also specify your own compression algorithm or use another compression algorithm supplied by SAS by specifying COMPRESS=algorithm-name. See the COMPRESS= data set option and the COMPRESS= system option in SAS Language Reference: Dictionary for more information.

The following table shows additional options that you can use with COMPRESS= when you create a compressed data file.

Options that You Can Use with COMPRESS=
To do this ... Use ... Example Restrictions
Control whether a compressed data set may be processed with random access (by observation number) POINTOBS= YES data set option
data test
(compress=yes
 pointobs=yes);
POINTOBS=YES increases CPU usage when you create or update a compressed data set.
Specify whether new observations are written to free space in a compressed SAS data set to save storage space REUSE=YES data set option or system option
data test
(compress=yes
 reuse=no);
If you set REUSE=YES, SAS automatically sets POINTOBS=NO.

Note:   POINTOBS=yes and REUSE=yes are mutually exclusive, that is, they cannot be used together.  [cautionend]

You can access observations in a compressed data file by specifying the observation number in:

Note:   You cannot access observations by number if you set REUSE=YES.  [cautionend]
See the REUSE= data set option in SAS Language Reference: Dictionary for more information on access by observation number.


Chapter Contents

Previous

Next

Top of Page

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