#!/usr/bin/ksh
#
# Name:    db2Script familyName
#
# Purpose: This is a sample shell script that shows
#          how to issue a set of DB2 command lines.
#

# Process the proper number if input parameters

if [ "$#" -ne 1 ]
then
   print -u2 'usage:  db2Script familyName   '
   exit 1
else
   print 'db2Script: Starting script for family ' $1
fi

db2 connect to $1
export LOG=db2Script.out

####### Customization notes #############################################
# Place the actual DB2 commands inside the begin and end !!!
# Remember to put the ; (semicolon) at the end of each logical statement
#########################################################################

db2 -o -t +v >> $LOG 2>&1 <<!!!
list database directory;

!!!
# The above !!! indicates the end of the long series of DB2 commands


db2 terminate

print ' '
print 'db2Script: Please see the following log for the details'
print '          of the execution of the DB2 commands: ' $LOG
print ' '
print 'db2Script: End of script'

exit 0

# end of file
