Hi all,
I am comming along with all this Linus/DB2/scripting business...I am no longer scared of it!! (LOL). But,
I need to create a .ksh script that does a REORGCHK and output only tables recommended for reorg.
My goal is to reorgchk and run reorgs based on entries in this reorg file as shown in the example below.
I have tried my hand at the following failing script and hope that gurus here can throw me a lifeline of examples on how
to script this. Here is what I tried to do that is failing: (Actually, I found it someplace):
START SHELL CODE
#!/bin/ksh
DBLIST="EMPLOYEE"

for DB_NAME in $DBLIST
do
db2 connect to $DB_NAME
db2 reorgchk current statistics on table all | grep -v SYSIBM | grep '*' | awk '/^DB2INST1/ && NF == 12 { print " REORG TABLE DB2INST1."$2 ";" }' > ReorgTables.sql
/db2home/db2inst1/sqllib/bin/db2 -tvf ReorgTables.sql &
done
exit 0
END SHELL CODE
Any help will be highly appreciated...

Thanks