Note: If this procedure is done incorrectly, it could jeopardize the system. Follow the steps exactly as noted.
Reasons to change the WORK location might include the following:
- Large files might be created in the /opt/sas/viya/config/var/tmp/compsrv/default directory, which can cause disk-space issues in the /opt/sas/ partition. By design, the directory location should be deleted when the SAS® session is terminated. But, if this deletion does not occur, you can override the directory location.
- You want to change the WORK location.
Linux
To change the WORK location for the compute server, add the following statement to the /etc/sysconfig/sas/sas-viya-compsrv- default file:
export COMPUTESERVER_TMP_PATH=<new-location>
Notes:
- The new location must already exist.
- Permissions must be set to 777 to allow compute-server sessions to write there.
- The /etc/sysconfig/sas/sas-viya-compsrv-default is a symlink to the /opt/sas/viya/config/etc/sysconfig/compsrv/default/sas-compsrv file.
- You do not need to restart any services after making the change.
In SAS® Viya® 3.5, the following option is available for Linux systems:
You can modify the vars.yml file and add the COMPUTESERVER_TMP_PATH variable to change the WORK location. Changing the WORK location in this way prevents you from having to make the change again after an upgrade is performed.
For example, the following shows the WORK location set to /tmp directly in the sas_viya_playbook/vars.yml file:
# Creates a workspaceserver sasenv_deployment file
FOUNDATION_CONFIGURATION:
X: COMPUTESERVER_TMP_PATH=/tmp
Note: The X above stands for the next consecutive number under FOUNDATION_CONFIGURATION. There are also two spaces before X: COMPUTESERVER_TMP_PATH=/tmp in the above example.
If you make this change post-deployment, you need to rerun the playbook to incorporate this change.
Windows
Complete the following steps to change the WORK location on Windows systems:
- In the compute server's start-up script (C:\Program Files\SAS\SPRE\bin\compsrv_start.cmd), locate the following section and add the new lines in step 2 immediately after it:
REM Set SAS required variables
SET SASINSTANCE=%instance%
SET "SASLOGROOT=%log_home%"
SET SASDEPLOYID=%SAS_DEPLOYMENT_ID%
SET SASHOME=%SAS_DEPLOYMENT_INSTALL_PATH%
SET SASPREHOME=%SAS_DEPLOYMENT_INSTALL_PATH%
SET SASCONFIG=%SAS_DEPLOYMENT_CONFIG_PATH%
- Update the compute server's start-up script (C:\Program Files\SAS\SPRE\bin\compsrv_start.cmd) to contain the following:
REM If usermods file exists, source it to pick up any overrides
IF EXIST "%config_home%\compsrv_start_usermods.cmd" (
CALL "%config_home%\compsrv_start_usermods.cmd"
)
- Remove the sas-compsrv.psd1 file from C:\ProgramData\SAS\Viya\etc\compsrv\default because it is void.
- Create the compsrv_start_usermods.cmd file in the C:\ProgramData\SAS\Viya\etc\compsrv\default directory and add the following:
REM Config for compute server
SET COMPUTESERVER_TMP_PATH="C:\temp\"
Note: In this example, the new WORK location is moved to C:\temp\.
- You can verify that this is now working by opening SAS® Studio V and running the following code that returns the new WORK location:
%let workpath=%sysfunc(pathname(work));
%put work=&workpath;
Notes:
- The new location must already exist.
- Permissions must be set to read, write, execute to allow compute-server sessions to write there.
- You do not need to restart any services after making the change.