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.
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:
Looks like this is a good option since we don't have to mess around any cfg or system file.
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.
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 🐵
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.
Hi,
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 -
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?
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 -
Using option.
options user='c:\temp\';
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 -
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.
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:
Looks like this is a good option since we don't have to mess around any cfg or system file.
Wow that's great thanks for sharing! Apparently any other property can be customized this way 🙂
- Cheers -
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.