You assign a SAS password to an
existing descriptor by using the DATASETS procedure. The DATASETS
procedure MODIFY statement enables you to assign, change, and delete
SAS passwords.
Here is the basic syntax for using PROC DATASETS to assign a password to an access
descriptor, a view descriptor, or a SAS data file:
PROC DATASETS LIBRARY=
libref MEMTYPE=
member-type;
MODIFY member-name (password-level = password-modification);
RUN;
In this syntax statement,
the password-level argument
can have one or more of the following values: READ=, WRITE=, ALTER=,
or PW=. The password-modification argument
enables you to assign a new password or to change or delete an existing
password.
For example, this PROC DATASETS statement assigns the password MONEY with the alter
level of protection to the access descriptor MYLIB.EMPLOYEE.
proc datasets library=mylib memtype=access;
modify employee (alter=money);
run;
In this case, users are prompted for a password when they try to browse or edit the
access descriptor or create view descriptors that are based on access descriptor MyLib.Employee.
In the next example, the PROC DATASETS statement assigns the passwords MYPW and MYDEPT
with read and alter levels of protection to view descriptor Vlib.CusPhon:
proc datasets library=vlib memtype=view;
modify cusphon (read=mypw alter=mydept);
run;
In this case, users are prompted for the SAS password when they try to read or update
the DBMS data, or try to browse or edit the view descriptor Vlib.CusPhon. You need
both levels to protect the data and descriptor. Assign a write
level of protection to prevent data updates.
To delete a password on a descriptor file or any SAS data set, put a slash after the
password:
proc datasets library=vlib memtype=view;
modify cusphon (read=mypw/ alter=mydept/);
run;
See the Base SAS Procedures Guide for
more examples of assigning, changing, deleting, and using SAS passwords
with PROC DATASETS.