SAS 9.1.3 Integration Technologies » Server Administrator's Guide


Starting Servers
Server Startup Command
Specifying Metadata Connection Information
Customizing the Server Command for COM/DCOM Connections
Initializing UNIX Environment Variables for Workspace Servers
Invoking (Starting) the Spawner
On Windows
Updating a Spawner Service
On UNIX
On Alpha/VMS
Server and Services Startup Order
Reference Materials
Object Server Parameters
Spawner Invocation Options
Starting Servers

Initializing UNIX Environment Variables for SAS Workspace Servers

In UNIX environments, many third-party databases require access information such as the default server address to be set as environment variables. To make these environment variables available to a SAS Workspace Server, you must create the workspace using a wrapper script that defines the variables before invoking SAS.

The following code is an example script.

#!/bin/ksh -p

# Purpose: Runs database setup scripts before invoking SAS.
#          Called by objspawn.

# Restore quotation marks around arguments that have multiple tokens.

function quoteme { #arg

   if [[ $# -gt 1 ]]; then
      quoteme="\"$*\""
   else
      quoteme=$1
   fi

   echo $quoteme
}

#  Run database setup scripts or set required environment
#  variables here.

 <script calls or export commands>

#  Reconstruct and execute the original SAS command.

cmd=''
for arg in "$@" ; do
   tmp="$(quoteme $arg)";
   cmd="$cmd $tmp"
done

eval exec $cmd

To use this script:

  1. Add your export statements or script calls and save the file as objspawn.setup in a location where all users have read and execute permissions.

  2. Set the execute bits for the file. You can do this using the following command:

    chmod 755 objspawn.setup
    
  3. Add objspawn.setup to the start of your sas command in the server definition. For example:
    objspawn.setup sas