Desktop productivity for business analysts and programmers

Default group of files created through EG

Accepted Solution Solved
Reply
Contributor Go
Contributor
Posts: 53
Accepted Solution

Default group of files created through EG

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


Accepted Solutions
Solution
‎07-18-2016 06:16 PM
Frequent Contributor
Posts: 100

Re: Default group of files created through EG

[ Edited ]

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

 

View solution in original post


All Replies
Super Contributor
Posts: 406

Re: Default group of files created through EG

[ Edited ]

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.

Solution
‎07-18-2016 06:16 PM
Frequent Contributor
Posts: 100

Re: Default group of files created through EG

[ Edited ]

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

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 349 views
  • 5 likes
  • 3 in conversation