WPS Analytics – data encryption

 

One of the new features of WPS Analytics is the ability to encrypt a WPS dataset. This has been a long desired (by me!) feature that makes its appearance in the newest release.

data cd;
input @1 CD $2. @4 Party $10.;
Label Party = ‘Party Affiliation’;
cards;
01 Democrat
02 Republican
03 Democrat
04 Republican
05 Republican
06 Republican
07 Democrat
08 Republican
09 Democrat
run;

data cdtestencrypt(encryptkey=”testpwd” encrypt=AES);
set cd;
run;

So we have the temporary dataset cdtestencrypt encrypted. If we try to run a PROC CONTENTS on it, the WPS log returns.

39 proc contents data=cdtestencrypt;
40 run;

ERROR: Data set WORK.cdtestencrypt is encrypted but the ENCRYPTKEY option is not set
NOTE: Procedure contents step took :
real time : 0.003
cpu time : 0.000

We get the same message if we try to read it back into another dataset or use it in any procedure. To be able to use the encrypted dataset, you will need to unencrypt it. Here’s how.

data a;
set cdtestencrypt(encryptkey=”testpwd”);
run;

and the log returns

51 data a;
52 set cdtestencrypt(encryptkey=”testpwd”);
53 run;

NOTE: 9 observations were read from “WORK.cdtestencrypt”
NOTE: Data set “WORK.a” has 9 observation(s) and 2 variable(s)
NOTE: The data step took :
real time : 0.008
cpu time : 0.000

Using the encrypted data set in a proc is as easy as:

63 proc print data =cdtestencrypt(encryptkey=”testpwd”);
64 run;

NOTE: 9 observations were read from “WORK.cdtestencrypt”
NOTE: Procedure print step took :

real time : 0.011
cpu time : 0.000

So, there you have it. You can now encrypt and decrypt WPD datasets to more fully protect your data from prying eyes and unauthorized use.

 

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in beautiful Tucson, Arizona. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS consulting and contract programming services and is an authorized reseller of WPS in North America.