Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set permissions when creating a dataset

Status
Not open for further replies.

tariqhali2

Technical User
Aug 15, 2011
3
US
Hello,

I am trying to figure out how to set permission while creating a dataset. If that is not possible how do I change permission to dataset that I have already created.

I use pc sas and the datasets are usually on a UNIX box so permission will be something like 775 or 777.

PROC SQL;
CREATE TABLE TABLE_NAME AS /* Is it possible to set permission here */
SELECT * FROM DATASET;
QUIT;

Thanks.
 
Hi Tariq,

When creating the dataset you have the ability to password protect aspects of it. For example, you can set separate passwords for reading, writing and altering the dataset/view. Alternatively, you can use the pw keyword to assign a full lock on your dataset.

Code:
data misc.class(pw=t3432) ;
   set sashelp.class ;
   run;
proc print data=misc.class(pw=t3432);
   run;

Try substituting pw= with read/write/alter= to see the effects.

If your datasets are stored on a unix box, you can also stick an x command after you create the dataset to apply the desired permissions from within SAS:


Code:
x "chmod 744 %sysfunc(pathname(MISC))/class.sas7bdat" ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top