04-15-2013 04:48 PM
I execute a data step using enterprise guide.
after this data step is it possible to set desired read /write permission for this new table. (by using sas code only)?
(Like how we change read/write permission of a file with a Unix command on unix prompt -> chmod 666 filename; similarly can we do that using SAS code...???)
04-15-2013 06:28 PM
Proc Datasets with the modify statement may do what you are looking for depending upon the permission you want.
|PROC DATASETS LIBRARY=libref MEMTYPE=member-type; |
MODIFY member-name (password-level = password-modification);
Password levels are READ=, WRITE=, ALTER= or PW=. The password can be different for each level.
04-16-2013 03:06 AM
Thanks Ballardw for your reply...
I looked at PROC DATASETS and I am a bit confused.. as READ=, WRITE=, ALTER= or PW=. are for giving passwords...
I will try to make my question more clear..
Suppose I have a dataset XYZ.sas7bdat
On unix system , when I do -> ls -ltr XYZ.sas7bdat
-rw------- ownername XYZ.sas7bdat
Now , as per your suggestions , after using PROC datasets, how can I get following ......
-rw-rw-rw- ownername XYZ.sas7bdat
04-16-2013 03:59 AM
You need to issue the unix chmod command to change permissions, using the SAS X command or one of it's cousins.
From memory it would be something like
X chmod 666 filename ;
which might have to be remote submitted
04-16-2013 04:02 AM
But if you are not the owner of the file and the permissions are -rw------- chmod will fail. You should talk to you IT guys about changing your user profile to create files with the required permissions.
02-01-2016 10:19 PM
If you do not have permissions andnot the owner unix will not let you write to the file.
SAS code will error.
You may want to use,
filename chmod pipe "chmod 777 /home/source/datasetname.sas7bdat";
data _null_; file chmod; run;
02-02-2016 11:27 AM