![]() Chapter Contents |
![]() Previous |
![]() Next |
| Syntax |
To set a password, first specify a SAS data set in one of the following:
| password-type=password <... password-type=password>) |
| ALTER= | |
| PW= | |
| READ= | |
| WRITE= |
![[cautionend]](../common/images/cautend.gif)
| Assigning a Password with a DATA Step |
This example prevents deletion or modification of the data set without a password.
/* assign a write and an alter password to MYLIBNAME.STUDENTS */ data mylibname.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 view ROSTER */
data mylibname.roster(read=green alter=red) /
view=mylibname.roster;
set mylibname.students;
run;
.
libname stored 'SAS-data-library-2'; /* assign a read and alter password to the program file SOURCE */ data mylibname.schedule / pgm=stored.source(read=green alter=red); ... DATA step statements ... run;
| Assigning a Password to an Existing Data Set |
/* assign an alter password to STUDENTS */ proc datasets library=mylibname; modify students(alter=red); run;
| Assigning a Password with a Procedure |
You can assign a password after an OUT= data set specification in PROC SQL.
/* assign a write and an alter password to SCORE */ proc sort data=mylibname.math out=mylibname.score(write=yellow alter=red); by number; run;
You can use a CREATE VIEW statement in PROC SQL to assign a password.
/* assign an alter password to the view BDAY */
proc sql;
create view mylibname.bday(alter=red) as
query-expression;
| Assigning a Password with the SAS Windowing Environment |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.