Previous Page | Next Page

z/OS Spawner

Defining the Shell Script for Starting SAS

The spawner invokes a UNIX System Services (USS) shell script that can be specified in either a SAS/CONNECT sign-on script or the -SASCMD spawner option.

Example:

-sascmd "/usr/local/bin/spawnsas.sh -nosasuser -dmr -noterminal -comamid tcp"

This command assumes that a shell script named spawnsas.sh is installed in /usr/local/bin . The command specifies the SAS options -nosasuser, -dmr, and -comamid tcp. The -noterminal option prevents the display of a dialog box in the server session. In addition, the two double quotes around the SAS options are required.

The shell script interprets the parameters that are received from the spawner and builds a TSO command that starts a SAS session.

The following shell script parses a command and interprets environment variables to build a TSO command to start SAS. This command is executed using the USS /bin/tso command. In this example, you must change the values of &prefix to the high-level qualifier of your CLIST library that contains the TSO command to start SAS. The BPX environment variables are specified to improve the start-up performance of a spawned SAS session.

Shell Script to Invoke SAS


#!/bin/sh
#
#  Initialize SAS startup command...
#
cmd="/bin/tso -t %SASTREXX \
-sasrxsysconfig '&prefix.SASRXCFG(ENW0NO)' \
$@"

#
#  Construct REXX parameters from environment variables
#  for sessions spawned by the SAS/Connect spawner
#
if [ -n "$INHERIT" ] ; then
   cmd="$cmd -inherit $INHERIT"
fi
if [ -n "$NETENCRALG" ] ; then
   cmd="$cmd -netencralg $NETENCRALG"
fi
if [ -n "$SASDAEMONPORT" ] ; then
   cmd="$cmd -sasdaemonport $SASDAEMONPORT"
fi
if [ -n "$SASCLIENTPORT" ] ; then
   cmd="$cmd -sasclientport $SASCLIENTPORT"
fi

#
#  Set additional environment variables...
#  SYSPROC specifies the data set containing the SAS REXX
#
export SYSPROC=&prefix.SASRX
export STEPLIB=
export TSOOUT=
export _BPX_SHAREAS=YES
export _BPX_BATCH_SPAWN=YES
export _BPX_SPAWN_SCRIPT=YES 
#
#  Start SAS
#
exec $cmd

Previous Page | Next Page | Top of Page