#!/bin/ksh
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#


########################################################################
#                                                                      #
# EBM BATCH JOB MACRO :     PAUSE                                      #
# Purpose             :     Suspend execution of the job.              #
#                                                                      #
########################################################################
. verify_jobstatus
. beginjob.${EBMSYS}.${JON}
. current_proc_level.${EBMSYS}.${JON}

if [ -f label.${EBMSYS}.${JON}.${PROC_LEVEL} ]
then
   . label.${EBMSYS}.${JON}.${PROC_LEVEL}
fi

if [ "a$BATCH_MODE" = "aMVS" ]
then
   if [ "a$STEPNAME" != a ]
   then
      . check_bypass_step

      if [ "$BYPASS" = "YES" ]
      then
          exit 0
      fi
   fi
fi

if [ -f beginproc.setparms.${EBMSYS}.${JON}.${PROC_LEVEL} ]
then
   . beginproc.setparms.${EBMSYS}.${JON}.${PROC_LEVEL}
fi

if [ -f setparm.${EBMSYS}.${JON}.${PROC_LEVEL} ]
then
   . setparm.${EBMSYS}.${JON}.${PROC_LEVEL}
fi

MSG=''; export MSG

for argument in $*
do
   i=`eval echo $argument`
   case $i in 
      msg=*)
         MSG="`eval echo $i|cut -f2 -d'='`" ; export MSG
      ;;
      verbose*)
         VERBOSE=YES ; export VERBOSE
       ;;

      *)
         MSG="$MSG $i" ; export MSG 
      ;;
  esac
done   

if [ "a$VALIDATE" = "ay" ]
then
   echo " "
   print_message PAUSE "in validation mode is not executed"
   if [ "a$MSG" != "a" ]
   then
      print_message PAUSE "msg=$MSG"
   fi
   echo " "
else
   $PACK/bin/btsh $PUBLIC/bin/pause.susjob.btsh 
   susjob $JON 2>&1 >$DEVNULL
   $PACK/bin/btsh $PUBLIC/bin/pause.rsmjob.btsh 
fi

exit 0
