#------------------------------------------------------------------------------- 
# Function to stop the DB2 Governor.                                                 
# Arguments: $1 'Y' or 'N' (stop or don't stop); 
#            $2 dbalias
#            $3 sleep interval in seconds - since a db2gov stop is not instantaneous.
#            $4 debug switch (ksh set: +x for off, -x for on).
#------------------------------------------------------------------------------- 

STOP_GOVERNOR()                                                                  
{                                                                                
 STOP=$1  
 DBNAME=$2
 SLEEP_INTERVAL=$3                                                       
 set "$4"                                                             
 if [[ "$1" = "Y" ]]; then                                                
   print "\n_________________________"                                                           
   print "\nStopping the DB2 Governor\n"                                             
   EXISTENCE_TEST "db2gov" "$4"                                       
   db2gov stop "$DBNAME"                                                         
   wait                                                                          
   sleep "$SLEEP_INTERVAL"                                                       
   print "_________________________\n"                                                           
 fi                                                                              
}                                                                                
