You can use data set options to assign passwords to unprotected members
in the DATA step when you create a new SAS data file.
This example prevents
deletion or modification of the data set without a password.
/* assign a write and an alter password to MYLIB.STUDENTS */
data mylib.students(write=yellow alter=red);
input name $ sex $ age;
datalines;
Amy f 25
… more data lines …
;
This example prevents
reading or deleting a stored program without a password and also prevents
changing the source program.
/* assign a read and an alter password to the SAS view ROSTER */
data mylib.roster(read=green alter=red) / view=mylib.roster;
set mylib.students;
run;
libname stored 'SAS-library-2';
/* assign a read and alter password to the program file SOURCE */
data mylib.schedule / pgm=stored.source(read=green alter=red);
… DATA step statements …
run;
Note: When you replace a SAS data
set that is alter-protected, the new data set inherits the Alter password.
To change the Alter password for the new data set, use the MODIFY
statement in the DATASETS procedure.