Changing the location of the _STPWORK directory that is used by the SAS® Stored Process Server or SAS® Workspace Server


In SAS® 9.2 M2 and later, you can change the location of the _STPWORK directory which is used by the SAS® Stored Process Server or SAS Workspace Server when running a SAS® Stored Process that uses the %STPBEGIN macro to create Package output.

For the Windows and Unix operating systems, you can specify the location of the _STPWORK directory by setting the STPWORK environment variable in the sasv9_usermods.cfg configuration file. For example:

-set STPWORK C:\yourdir\

The sasv9_usermods.cfg configuration file, used when starting the SAS Stored Process Server, is located at a path that is similar to the following:

<SAS-configuration-directory>/Lev1/SASApp/sasv9_usermods.cfg

For the z/OS operating system, you can specify the location of the _STPWORK directory by setting the STPWORK environment variable in the StoredProcessServer_usermods.sh shell script. For example:

#!/bin/sh
#
# StoredProcessServer_usermods.sh
#
# This script extends StoredProcessServer.sh.  Add local options
# to this file so they will be preserved.
#
USERMODS_OPTIONS="-set 'STPWORK user-specified-path/stpwork' -UTILLOC='user-specified-path/SampleData/cubework'"

The StoredProcessServer.sh shell script, used when starting the SAS Stored Process Server, is located at a path that is similar to the following

<SAS-configuration-directory>/Lev1/SASApp/StoredProcessServer/StoredProcessServer_usermods.sh

If the environment variable STPWORK is not set when the server is started, then the %STPBEGIN macro determines a temporary directory based on the operating system and places that value in the _STPWORK reserved macro variable.

If the environment variable STPWORK is set when the server is started, then the %STPBEGIN macro uses the directory specified as a starting point to create the temporary directory.

When troubleshooting, you can output the value of the _STPWORK macro variable by including the following statements in a SAS Stored Process:

%stpbegin; %put _STPWORK value is: &_STPWORK;