To access password-protected files, use the same data set options
that you use to assign protection.
-
/* Assign a read and alter password to the stored program file*/
/*STORED.SOURCE */
data mylib.schedule / pgm=stored.source
(read=green alter=red);
<… more DATA step statements …>
run;
/*Access password-protected file*/
proc sort data=mylib.score(write=yellow alter=red);
by number;
run;
-
/* Print read-protected data set MYLIB.AUTOS */
proc print data=mylib.autos(read=green);
run;
-
/* Append ANIMALS to the write-protected data set ZOO */
proc append base=mylib.zoo(write=yellow) data=mylib.animals;
run;
-
/* Delete alter-protected data set MYLIB.BOTANY */
proc datasets library=mylib;
delete botany(alter=red);
run;
Passwords are hierarchical in terms of gaining access.
For example, specifying the ALTER password gives you Read and Write
access. The following example creates the data set STATES, with three
different passwords, and then reads the data set to produce a plot:
data mylib.states(read=green write=yellow alter=red);
input density crime name $;
datalines;
151.4 6451.3 Colorado
… more data lines …
;
proc plot data=mylib.states(alter=red);
plot crime*density;
run;