Password Support

IML Studio enables you to open SAS data sets that are password protected. For background information about passwords for SAS data sets, refer to the section File Protection under SAS Files Concepts in the book SAS 9.4 Language Reference Concepts. The specifics of how IML Studio manages passwords vary depending on whether you access a file using a dialog box or the IMLPlus language.

File Access Using Dialog Boxes

IML Studio provides two dialog boxes for opening SAS data sets: the Open File dialog box, and the Open Server Data Set dialog box. Both dialog boxes support data set passwords as follows:

If you open a password-protected SAS data set using a dialog box, IML Studio will prompt you to enter the data set's READ password. IML Studio will remember that READ password as long as the data set is open in IML Studio.

IML Studio provides two dialog boxes for saving SAS data sets: the Save Data As dialog box, and the Save As Server Data Set dialog box. Both dialog boxes support data set passwords as follows:

If you save a SAS data set using a dialog box and the target file is protected with an ALTER password, IML Studio will prompt you to enter the file's ALTER password. IML Studio will remember that ALTER password as long as the data set is open in IML Studio.

File Access Using The IMLPlus Language

IMLPlus provides two mechanisms for interacting with SAS data sets: the traditional IML file I/O statements, and the methods of the IMLPlus DataObject class. Both of these file access mechanisms support data set passwords via data set options. SAS provides four data set options that control passwords: PW=, READ=, WRITE=, and ALTER=. These options are documented in the book SAS 9.4 Data Set Options Reference. IML Studio supports both plain text passwords as well as passwords that have been encoded with the PWENCODE procedure.

The usage of data set options with the traditional IML file I/O statements is identical in IMLPlus and PROC IML. You can specify data set options in a CREATE statement, an EDIT statement, or a USE statement by enclosing the options in parentheses after the data set name.

The following table states the support for SAS passwords that is provided by the methods of the DataObject class:

DataObject Method Password Support
CreateFromFile Does not support data set options and therefore can only open data sets that are not protected with a READ password.
CreateFromOtherServerDataSet Does not support data set options. Use the method CreateFromOtherServerDataSetEx instead.
CreateFromOtherServerDataSetEx Accepts a data set options string. Uses the specified PW or READ password to open a password-protected data set. If the data set options string specifies WRITE and/or ALTER passwords, the DataObject remembers those passwords in case they are needed in the future to save the data set.
CreateFromServerDataSet Does not support data set options. Use the method CreateFromServerDataSetEx instead.
CreateFromServerDataSetEx Accepts a data set options string. Uses the specified PW or READ password to open a password-protected data set. If the data set options string specifies WRITE and/or ALTER passwords, the DataObject remembers those passwords in case they are needed in the future to save the data set.
WriteToFile Uses any previously specified passwords. If the target file is password protected and IML Studio does not know the ALTER password, the method will stop the program with an error.
WriteToOtherServerDataSet Uses any previously specified passwords. If the target file is password protected and IML Studio does not know the ALTER password, the method will stop the program with an error.
WriteToServerDataSet Uses any previously specified passwords. If the target file is password protected and IML Studio does not know the ALTER password, the method will stop the program with an error.
WriteVarsToOtherServerDataSet Creates a SAS data set that has no password protection.
WriteVarsToServerDataSet Creates a SAS data set that has no password protection.
Algorithm for Handling Unspecified Passwords

When IML Studio stores a SAS data set either in a .sas7bdat file or on a SAS Workspace Server, IML Studio must specify the READ password, the WRITE password, and the ALTER password, even if they are blank. In many situations, IML Studio will only know one or two of the three passwords. For example, if you use the Open File dialog box to open a SAS data set that is protected with a READ password, IML Studio will prompt you to enter the READ password. As long as that data set remains open in IML Studio, IML Studio knows the READ password. If you later save the data set, IML Studio must determine how to assign the passwords for the new file.

IML Studio uses the following algorithm to determine the passwords when writing a data set file:

It is important to be aware that IML Studio does not have a magic ability to extract the WRITE and ALTER passwords from a SAS data set being opened in order to propagate those passwords if the data is later saved. If you don't provide a password to IML Studio, IML Studio won't know it.