Use the casout command with the /t operand to stop a JES initiator without stopping the region.
if test "$#" -ne 2
then
echo "*** ERROR - missing parameters"
echo "usage: stopclass region-name class"
exit 99
fi
region=`echo $1 | sed 's/ .*$//'`
class=`echo $2 | tr '[a-z]' '[A-Z]'`
COBDIR=/opt/microfocus/cobol
export COBDIR
PATH=$COBDIR/bin:$PATH
export PATH
LD_LIBRARY_PATH=$COBDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
casout -r$region -v
if test "$?" -eq 0
then
casout -r$region -v | grep 'tor '$class | cut -d" " -f5 >startClass.txt
processID=`cat startClass.txt | sed 's/ .*$//'`
casout -r$region -t$processID
else
echo "*** ERROR - Return Code: "$?
exit $?
fi
jobrc=$?
case "$jobrc"
in
0) echo "Processing Successful: "$jobrc;;
15) echo "*** ERROR - Invalid Region Name: "$region
echo "*** Return Code: "$jobrc;;
99) echo "*** ERROR - JES not available for Region: "$region
echo "*** Return Code: "$jobrc;;
199) echo "*** ERROR - User ID not authorised: "$region
echo "*** Return Code: "$jobrc;;
255) echo "*** ERROR - Region is not started: "$region
echo "*** Return Code: "$jobrc;;
*) echo "*** ERROR - Return Code: "$jobrc;;
esac