Hi experts,
I execute a data step using enterprise guide.
data newtable;
set existtab;
code statement1..
code statement2...
run;
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...???)
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); |
run;
quit;
Password levels are READ=, WRITE=, ALTER= or PW=. The password can be different for each level.
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
I get,
-rw------- ownername XYZ.sas7bdat
Now , as per your suggestions , after using PROC datasets, how can I get following ......
-rw-rw-rw- ownername XYZ.sas7bdat
Thanks !
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
Richard
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.
Richard
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.