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

Hello,

 

I need to change the WORK library folder location based on user. I'm wondering if anyone can help 🙂

 

We installed SAS on a server with roughly 3-5 people accessing the software. My boss wants her Work location to be in C: drive but the rest of the users in H: drive.

 

I opened the SASV9.CFG file but I can't seem to find a way to set the WORK location based on user. The best I could do is to use:

 

-WORK "H:\WORK\!USERNAME"

 

However, all of the data sets are stored in the H: drive.

 

Does anyone have any suggestions?

 

Thanks so much.

1 ACCEPTED SOLUTION

Accepted Solutions
kisumsam
Quartz | Level 8

Thanks all! I actually found a solution that I haven't come across on this forum.

 

The Work library path can be set in the SAS properties:

 

test.png

 

 

Looks like this is a good option since we don't have to mess around any cfg or system file.

 

 

View solution in original post

12 REPLIES 12
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why?  Work location is a termporary area only for the current session.  If you need to store outputs/datasets etc. then setup an area and set libnames directly to the store area.  Work is not the place for storing anything other than temporary elements.

gamotte
Rhodochrosite | Level 12
"My boss wants" is a good enough reason.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

That depends, are they the best person to decide that, is it inline with company policy, is that secure etc.

"My boss wants me to chuck all these financial papers out of the window" - ok, good enough reason 🐵

gamotte
Rhodochrosite | Level 12

If I have written proof that he asked me to do that and I advised him not to, yes.

Anyway, my answer was tongue in cheek.

Oligolas
Barite | Level 11

Hi,

 

  1. Look  for the sasv9.cfg file in your language under Program Files\SASHome\SASFoundation\9.4\nls Directory
  2. Create a copy and edit it
  3. Adapt the line starting with '-WORK' with the path you want as for i.e. "-WORK "!TEMP"
  4. Create a shortcut to SAS and adapt the path to load your edited cfg file:
  5. "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\TEMP\sasv9_mod.cfg"
  6. Save the shortcut and start SAS

It will significantly improve the working speed in case your admin set the default work path to a network drive and you remap to your local SSD

________________________

- Cheers -

kisumsam
Quartz | Level 8

Thanks Oligolas. So your suggestion is to improve the working speed? I'm hoping to save the working data sets in different folders based on the server user. 

 

E.g.

 

User ABC101 --> C:\Work

Other Users --> H:\Work

 

Do you think that's possible?

 

Oligolas
Barite | Level 11

Hi,

 

afaik you can not change the work path at run time, I would rather work with the SAS libnames and educate the users to use a defined common library.

But you could use a Batch file for loading different shortcuts with different cfg files.

 

 

________________________

- Cheers -

Ksharp
Super User

Using option.

 

options user='c:\temp\';

Oligolas
Barite | Level 11

ehm yeah careful with that, it would save permanently any dataset created at run time which may not be what was wanted, depends on what your boss really intend to do.

 

________________________

- Cheers -

andreas_lds
Jade | Level 19

The work-location can be set in any cfg-file with

-WORK "path"

SAS will create a sub-folder in the given directory with the name of the user and some more chars to make it unique. Afaik the last use of "-WORK" wins. So you use one "-WORK"-statement in sasv9_usermods.cfg with the default path.

 

With -config statement (in sasv9_usermods.cfg) another cfg-file can be loaded, so you need a cfg-file for each user: empty for those using the default path and with another "-WORK"-statement for your boss. Concatenating the file name in the config-statement didn't work, so we added a SET-statement in appservercontext_env_usermods.bat, like:

SET USER_WORK_CFG=PATH_TO_CFG\%username%.cfg

and used

-config "!USER_WORK_CFG"

in sasv9_usermods.cfg in SASApp directory.

 

I would not allow any user to have work on C-drive of a sas-server without having a very limiting quota management, especially if the config is also stored on C. If the work-datasets fill the available space on C, system-stability could be risked.

kisumsam
Quartz | Level 8

Thanks all! I actually found a solution that I haven't come across on this forum.

 

The Work library path can be set in the SAS properties:

 

test.png

 

 

Looks like this is a good option since we don't have to mess around any cfg or system file.

 

 

Oligolas
Barite | Level 11

Wow that's great thanks for sharing! Apparently any other property can be customized this way 🙂

 

________________________

- Cheers -

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!

How to Concatenate Values

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.

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
  • 12 replies
  • 24749 views
  • 7 likes
  • 6 in conversation