Previous Page | Next Page

SAS Data Set Options

ENCRYPT= Data Set Option

Specifies whether to encrypt an output SAS data set.
Valid in: DATA step and PROC steps
Category: Data Set Control
Restriction: Use with output data sets only.

Syntax Description
Using the ENCRYPT=YES Option
See Also



Syntax Description


encrypts the file. This encryption 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.

Record all passwords when using ENCRYPT=YES.

If you forget the passwords, you cannot reset it without assistance from SAS. The process is time-consuming and resource-intensive.  [cautionend]


does not encrypt the file.


When using ENCRYPT=YES, the following list applies:

Using the ENCRYPT=YES Option

This example creates an encrypted SAS data set using encryption:

data salary(encrypt=yes read=green);
   input name $ yrsal bonuspct;
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);

See Also

Data Set Options:

ALTER= Data Set Option

PW= Data Set Option

READ= Data Set Option

WRITE= Data Set Option

SAS Data File Encryption in SAS Language Reference: Concepts

Previous Page | Next Page | Top of Page