General form, COMPRESS=
system option:
OPTIONS COMPRESS= NO | YES | CHAR | BINARY;
NO
is the default setting,
which does not compress the data set.
CHAR or YES
uses the Run Length
Encoding (RLE) compression algorithm, which compresses repeating consecutive
bytes such as trailing blanks or repeated zeros.
BINARY
uses Ross Data Compression
(RDC), which combines run-length encoding and sliding-window compression.
|
General form, COMPRESS=
data set option:
DATA SAS-data-set (COMPRESS=
NO | YES | CHAR | BINARY);
SAS-data-set
specifies the data
set that you want to compress.
NO
is the default setting,
which does not compress the data set.
CHAR or YES
uses the Run Length
Encoding (RLE) compression algorithm, which compresses repeating consecutive
bytes such as trailing blanks or repeated zeros.
BINARY
uses Ross Data Compression
(RDC), which combines run-length encoding and sliding-window compression.
|
data company.customer_compressed (compress=char); set company.customer; run;
NOTE: There were 89954 observations read from the data set COMPANY.CUSTOMER. NOTE: The data set COMPANY.CUSTOMER_COMPRESSED has 89954 observations and 11 variables. NOTE: Compressing data set COMPANY.CUSTOMER_COMPRESSED decreased size by 32.81 percent. Compressed is 991 pages; un-compressed would require 1475 pages. NOTE: DATA statement used (Total process time): real time 3.90 seconds cpu time 0.96 seconds |
General form, POINTOBS=
data set option:
DATA SAS-data-set (COMPRESS=YES
| CHAR | BINARY POINTOBS= YES | NO);
SAS-data-set
specifies the data
set that you want to compress.
YES
is the default setting,
which allows random access to the data set.
NO
does not allow random
access to the data set.
|
data company.customer_compressed (compress=yes pointobs=no); set company.customer; run;
General form, REUSE=
system option:
OPTIONS REUSE= NO | YES;
NO
is the default setting,
which specifies that SAS does not track unused space in the compressed
data set.
YES
specifies that SAS
tracks free space and reuses it whenever observations are added to
an existing compressed data set.
|
General form, REUSE=
data set option:
DATA SAS-data-set (COMPRESS=YES
REUSE=NO | YES);
SAS-data-set
specifies the data
set that you want to compress.
NO
is the default setting,
which specifies that SAS does not track unused space in the compressed
data set.
YES
specifies that SAS
tracks free space and reuses it whenever observations are added to
an existing compressed data set.
|
data company.customer_compressed (compress=yes reuse=yes); set company.customer; run;
1 2 3 4 5 6 7 8 9 @ +/1 1 # @ +/1 2 # %
Numeric Data, No Compression
The following program
creates the SAS data set Retail.Orders, which contains numeric data
and is uncompressed. The second DATA step reads the uncompressed data
file.
data retail.orders(compress=no);
infile flat1;
input Customer_ID 12.
Employee_ID 12.
Street_ID 12.
Order_Date date9.
Delivery_Date date9.
Order_ID 12.
Order_Type comma16.
Product_ID 12.
Quantity 4.
Total_Retail_Price dollar13.
CostPrice_Per_Unit dollar13.
Discount 5. ;
run;
data _null_;
set retail.orders;
run; |
Numeric Data, BINARY Compression
The following program
creates the SAS data set Retail.Orders_binary, which contains numeric
data and uses BINARY compression. The second DATA step reads the compressed
data file.
data retail.orders_binary(compress=binary);
infile flat1;
input Customer_ID 12.
Employee_ID 12.
Street_ID 12.
Order_Date date9.
Delivery_Date date9.
Order_ID 12.
Order_Type comma16.
Product_ID 12.
Quantity 4.
Total_Retail_Price dollar13.
CostPrice_Per_Unit dollar13.
Discount 5. ;
run;
data _null_;
set retail.orders_binary;
run; |
Numeric Data, CHAR Compression
The following program
creates the SAS data set Retail.Orders_char, which contains numeric
data and uses CHAR compression. The second DATA step reads the compressed
data file.
data retail.orders_char(compress=char);
infile flat1;
input Customer_ID 12.
Employee_ID 12.
Street_ID 12.
Order_Date date9.
Delivery_Date date9.
Order_ID 12.
Order_Type comma16.
Product_ID 12.
Quantity 4.
Total_Retail_Price dollar13.
CostPrice_Per_Unit dollar13.
Discount 5. ;
run;
data _null_;
set retail.orders_char;
run; |
Character Data, No Compression
The following program
creates the SAS data set Retail.Customers, which contains character
data and is uncompressed. The second DATA step reads the uncompressed
data file.
data retail.customers(compress=no);
infile flat2;
input Customer_Country $40.
Customer_Gender $1.
Customer_Name $40.
Customer_FirstName $20.
Customer_LastName $30.
Customer_Age_Group $12.
Customer_Type $40.
Customer_Group $40.
Customer_Address $45.
Street_Number $8. ;
run;
data _null_;
set retail.cutomers;
run; |
Character Data, BINARY Compression
The following program
creates the SAS data set Retail.Customers_binary, which contains character
data and uses BINARY compression. The second DATA step reads the compressed
data file.
data retail.customers_binary(compress=binary);
infile flat2;
input Customer_Country $40.
Customer_Gender $1.
Customer_Name $40.
Customer_FirstName $20.
Customer_LastName $30.
Customer_Age_Group $12.
Customer_Type $40.
Customer_Group $40.
Customer_Address $45.
Street_Number $8. ;
run;
data _null_;
set retail.customers_binary;
run; |
Character Data, CHAR Compression
The following program
creates the SAS data set Retail.Customers_char, which contains character
data and uses CHAR compression. The second DATA step reads the compressed
data file.
data retail.customers_char(compress=char);
infile flat2;
input Customer_Country $40.
Customer_Gender $1.
Customer_Name $40.
Customer_FirstName $20.
Customer_LastName $30.
Customer_Age_Group $12.
Customer_Type $40.
Customer_Group $40.
Customer_Address $45.
Street_Number $8. ;
run;
data _null_;
set retail.customers_char;
run; |