Sometimes other people want to use the data sets you create. Sure they can read em' but what if they need to edit them too? The following code will allow you to change the permissions of your data sets within SAS:
%let PERMIS = 777;
%let extpath = /sasusers/mark/sasuser.v91;
%let dataset = edit_me;
filename chmod pipe "chmod &PERMIS %trim(&extpath)/&dataset..
data _null_;
file chmod;
run;
note: the data set name specified must be lowercase or else it wont work. You could use the %lower statement to do this automatically.
Chmod changes the permissions of the data set in the library specified. How does it work?
777 is an octal. It refers to a permission configuration that allows absolutely anyone to read or write to the files specified in 'dataset'. The first number refers to the user, the second refers to your group and the third number refers to everyone else.
The values and their meanings can be seen here:
http://en.wikipedia.org/wiki/Chmod under 'numerical permissions'
This is great to use when SAS annoyingly reverts permission to read only whenever you update a file. If only it was this easy with women!
No comments:
Post a Comment