IMSTAT Procedure (Data and Server Management)

SAVE Statement

The SAVE statement enables you to save an in-memory table as a SASHDAT table or a CSV file. The table must be the active table. You specify the active table with the DATA= option in the IMSTAT procedure or with the TABLE statement.

Deleting Rows and Saving a Table to HDFS

Syntax

SAVE <options>;

Optional Arguments

BLOCKSIZE

specifies the block size to use for distributing the data set. Suffix values are B (bytes), K (kilobytes), M (megabytes), and G (gigabytes).

Interaction If the in-memory table is partitioned, the BLOCKSIZE= specification is ignored. The server determines the block size based on the size of the partitions.

COPIES=n

specifies the number of replications to make for the data set (beyond the original blocks). The default value is 1. You can specify COPIES=0 if you do not need replications for redundancy.

CSV

specifies to save the table as a comma-separated value file. The first line of the file includes the variable names.

Interaction The SQUEEZE option is ignored if you specify CSV.
Examples
  table hps.stocks;
  save path="/hps/stocks2.csv" fullpath replace csv;
run;
To load a CSV file to memory, you can use the SAS Data in HDFS engine and PROC LASR as follows:
libname hpscsv sashdat host="grid001.example.com" 
    install="/opt/TKGrid" path="/hps";

proc lasr add data=hpscsv.stocks2(filetype=csv getnames=yes)
     port=10010;
  performance host="grid001.example.com";
run;

ENCRYPTKEY=key-value

specifies a key value for AES (Advanced Encryption Standard) encryption.

See For more information, see ENCRYPT= Data Set Option.

FULLPATH

specifies that the value for the PATH= option specifies the full path for the file, including the filename (without the SASHDAT extension). The filename portion of the quoted string is expected to be in lowercase characters.

PATH='HDFS-path'

specifies the directory in which to store the table as a SASHDAT file. The value is case sensitive. The filename for the SASHDAT file that is stored in the path is always lowercase.

Note: If the PATH= option is not specified, the server attempts to save the table in the /user/userid directory. The userid is the user ID that started the server instance.

REPLACE

specifies that the SASHDAT file should be overwritten if it already exists.

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.

SIGNERFILEPOLICY

specifies to apply the encryption policies stored in metadata to the file.

See For more information, see SIGNERFILEPOLICY Data Set Option.

SQUEEZE

specifies to save the table in the SASHDAT file in compressed form.

Note: You must specify this option even if the in-memory table is compressed. By default, tables are saved in uncompressed form, regardless of whether the in-memory table is compressed or not.