IMSTAT Procedure (Data and Server Management)

COMPRESS Statement

The COMPRESS statement is used to create a compressed in-memory table from another in-memory table. The compressed table is stored as a temporary table.

Syntax

COMPRESS </ options>;

COMPRESS Statement Options

INFO

requests the server to report information about the compression state of a table, but does not perform any compression. On a compressed table, the report includes information about the compressed size and compression ratio. On an uncompressed table, the results include the uncompressed size only. The option is also useful to find out how much memory a table consumes.

SAVE=table-name

saves the result table so that you can use it in other IMSTAT procedure statements like STORE, REPLAY, and FREE. The value for table-name must be unique within the scope of the procedure execution. The name of a table that has been freed with the FREE statement can be used again in subsequent SAVE= options.

Details

Interactions

You can apply compression to regular in-memory tables, to partitioned tables, and to partitioned and ordered tables. You can apply compression with an active WHERE clause and with tables that contain rows that are marked for deletion (purging). Rows that do not pass the WHERE clause or rows that are marked for deletion are not transferred to the temporary table. You cannot compress a view.
If a table is already compressed, the statement produces information about the compressed and uncompressed size of the table. No further compression is performed.

ODS Table Names

The COMPRESS statement generates the following ODS table.
ODS Table Name
Description
Option
Compress
Information from compressing or uncompressing tables
Default
TempTable
Information about a temporary table
When INFO is not specified and COMPRESS generates a compressed table.
For information about using the ODS table with SAVE= option, see the Details section of the STORE statement.

Example

data lasr.prdsale;
    set sashelp.prdsale;
run;

proc imstat data=lasr.prdsale;
    compress / info;  1
run;
    compress;
    table lasr.&_templast_;
    promote prdsalecomp;  2
run;
    table lasr.prdsalecomp;
    compress / info;  3
quit;
1 The INFO option does not attempt to compress the table. The compression information is shown in Compression Information for an Uncompressed Table.
2 The PROMOTE statement is used to make the compressed table into a permanent table and give it a name.
3 The INFO option shows the compression information for the compressed table. See Compression Information for a Compressed Table.
Compression Information for an Uncompressed Table
Compression information for the uncompressed form
Compression Information for a Compressed Table
Compression information for the compressed form