Hi All,
When I create (touch) files in UNIX terminal, the default group is xxx and to change it yyy, i can use newgrp command and I will be fine,
But When I create files(for example a test data set) through Enterprise Guide, the default group goes to xxx and I want it to be yyy, how can i achive this ? thanks
Jan's suggestion, above is a good one, and probably the best if you don't mind changing the default group for the entire directory.
If however you only want to change the default group for some files but not for all files, you can issue UNIX commands from your SAS program using %sysexec
For example, here I'm issuing a df -k command which will put a listing of the space allocations on my UNIX server into a text file called df_-k.txt
/** Create a listing of the space allocations on UNIX server. **/
%sysexec %str(df -k > /home/barbourj/df_-k.txt);
Using %sysexec, you could just as easily issue chmod commands.
Hope that helps,
Jim
Hi Go,
You can force the group of a file by setting the set-group-ID bit of the containing directory. If a directory’s set-group-ID bit is set, newly created subfiles inherit the same group as the directory. So in addition you should also set the group of that directory to the desired group as a one-time command.
You can set the set-group-ID bit and change its group as follows:
# chmod g+s mydir
# chgrp yyy mydir
Existing files in the directory will not be affected.
Hope this helps,
Regards Jan.
Jan's suggestion, above is a good one, and probably the best if you don't mind changing the default group for the entire directory.
If however you only want to change the default group for some files but not for all files, you can issue UNIX commands from your SAS program using %sysexec
For example, here I'm issuing a df -k command which will put a listing of the space allocations on my UNIX server into a text file called df_-k.txt
/** Create a listing of the space allocations on UNIX server. **/
%sysexec %str(df -k > /home/barbourj/df_-k.txt);
Using %sysexec, you could just as easily issue chmod commands.
Hope that helps,
Jim
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: