BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Go
Quartz | Level 8 Go
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
jimbarbour
Meteorite | Level 14

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

2 REPLIES 2
jklaverstijn
Rhodochrosite | Level 12

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.

jimbarbour
Meteorite | Level 14

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

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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