ENCRYPT= Data Set Option

Specifies whether to encrypt an output SPD Engine data set.
Valid in: DATA step and PROC steps
Restrictions: use with output data sets only

ENCRYPT=YES cannot be used with COMPRESS=

Engine: SPD Engine only

Syntax

ENCRYPT=YES | NO

Syntax Description

YES
encrypts the file. This encryption method uses passwords that are stored in the data set. At a minimum, you must specify the READ= or the PW= data set option at the same time that you specify ENCRYPT=YES. Because the encryption method uses passwords, you cannot change any password on an encrypted data set without re-creating the data set.
CAUTION:
Record all passwords when ENCRYPT=YES.
If you forget the passwords, you cannot reset it without assistance from SAS. The process is time-consuming and resource-intensive.
NO
does not encrypt the file.

Details

Encryption and compression are mutually exclusive in SPD Engine.
You cannot create an SPD Engine data set with both encryption and compression. If you use ENCRYPT=YES data set option and the COMPRESS= data set or LIBNAME option, the following error is generated:
ERROR: The data set was not compressed because compression and
       encryption cannot both be specified. 
When you copy a Base SAS data set that is compressed and encrypted to an SPD Engine data set, the compression is dropped. SAS retains the security of the data set instead of the compression.

Example: Encrypting a Data Set

The following example encrypts the data set:
libname depta spde '/datasecret';
data salary(encrypt=yes read=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
;
To use this data set, specify the READ password:
proc contents data=salary(read=green);
run;