Specifies a key value for AES encryption.
Valid in: | DATA step and PROC step |
Range: | 1 to 64 bytes |
Restrictions: | Use with SAS 9.4 or later only |
Use only with AES-encrypted data sets |
assigns an encrypt key value. You must use the ENCRYPTKEY= data set option with ENCRYPT=AES. The key value can be up to 64-bytes long. You are able to create an ENCRYPTKEY= key value with or without quotation marks using the following rules:
encryptkey=key-value encryptkey=key-value1
encryptkey='key-value' encryptkey='1234*#mykey'
encryptkey="key-value" encryptkey="1234*#mykey" %let mykey=abcdefghi12; encryptkey=&key-value
data _null_;
key=length(unicodec('key-value','UTF8'));
put 'key length=' key;
run;
Note | You cannot change the ENCRYPTKEY= key value on an AES-encrypted data set without re-creating the data set. |
copy in=OldLib out=NewLib; select salary(encryptkey=key-value); run;
%let secret=MyValue;
data my.dsname(encrypt=aes encryptkey="&secret");
data spdelib.salary(encrypt=aes encryptkey=green); input name $ yrsal bonuspct; datalines; Muriel 34567 3.2 Bjorn 74644 2.5 Freda 38755 4.1 Benny 29855 3.5 Agnetha 70998 4.1
proc contents data=spdelib.salary(encryptkey=green); run;