The following example shows how
to use the SQUEEZE= data set option for the SAS LASR Analytic Server.
Creating a Compressed Table with a DATA Step
libname example sasiola host="grid001.example.com" port=10010 tag=hps;
data example.prdsale(squeeze=yes);
set sashelp.prdsale;
run;
After the table is loaded
to memory, you can access the compressed table with the Example.Prdsale
libref.
The server supports the APPEND= option
for compressed tables. The following example shows how to add new
rows (uncompressed) to the compressed table:
Appending Rows to a Compressed Table
data example.prdsale(append=yes);
somelib.newrows;
run;
Because the Example.Prdsale
table is already compressed, the new rows are automatically compressed
as they are appended to the table. Specifying SQUEEZE= with APPEND=
has no effect. If the table is compressed, the server compresses the
new rows. If the table is not compressed, the server does not compress
the new rows (even if SQUEEZE=YES is specified). The compressed or
uncompressed state of the table determines how the rows are appended.
Partitioning and compression
are supported together. The following example creates a new in-memory
table that is partitioned and compressed:
Creating a Partitioned and Compressed Table
data example.iris(partition=(species) squeeze=yes);
set sashelp.iris;
run;
data example.iris(append=yes);
set somelib.moreirises;
run;
In the first DATA statement,
the Iris data set is loaded to memory on the server and is partitioned
by the formatted values of the Species variable. The table is also
compressed. In the second DATA statement, the table is appended to
with more rows. Because the in-memory table is already partitioned
and compressed, the new rows are automatically partitioned and compressed
when they are appended.