CAUTION:
When using
ENCRYPTKEY= to encrypt a data set, record the key value.
If you forget the ENCRYPTKEY=
key value, you lose your data. SAS cannot assist you in recovering
the ENCRYPTKEY= key value because the key value is not stored with
the data set.
You must use the ENCRYPTKEY=
option when you are creating or accessing a SAS data set or SPD Engine
data set with AES encryption. You cannot use the FedSQL language to
create an SPD Server table with AES encryption. However, you can access
an existing SPD Server table that has AES encryption by specifying
its encryption key value with ENCRYPTKEY=.
The ENCRYPTKEY= table
option does not protect the file from deletion or replacement. Encrypted
data sets can be deleted by using any of the following scenarios without
having to specify an ENCRYPTKEY= key value:
-
the KILL option in PROC DATASETS
-
the DROP statement in PROC SQL
-
-
the DROP TABLE statement in FedSQL
The ENCRYPTKEY= option
prevents access to the contents of the file. To protect the file from
deletion or replacement, the file must also contain an ALTER= password.
The following DATASETS
procedure statements require you to specify the ENCRYPTKEY= key value
when working with protected files: AGE, AUDIT, APPEND, CHANGE, CONTENTS,
MODIFY, REBUILD, and REPAIR statements.
append base=name data=name(encryptkey=key-value);
run;
The option can be specified either in parentheses after
the name of the SAS data file or after a forward slash.
It is possible to use
a macro variable as the ENCRYPTKEY= key value. When you specify a
macro variable for the ENCRYPTKEY= key value, you must enclose the
macro variable in double quotation marks. If you do not use the double
quotation marks, unpredictable results can occur. The following example
defines a macro variable and uses the macro variable as the ENCRYPTKEY=
key value:
%let secret=myvalue;
create table myschema.dsname {options encrypt=aes encryptkey="&secret"};