I have ran simular scripts with the following. You can created the ddl's on the fly as I did below and run each one separatly or make the ddl up beforehand. Either way you can save the results under a different name and you can also pass in arguments to include into your scripts. I am fairly new to db2 and this may not be effective but I have been doing simular things for several months. I have stored about 100 different scripts on my ipod nano that are menu driven. This way I can quickly connect to over 50 different PC with DB2 access and query away and save the reports to my ipod within seconds.
@echo off
cls
if exist .\ddl\script1.ddl del .\ddl\script1.ddl
if exist .\reports\report1.txt del .\reports\report1.txt
if exist .\ddl\script2.ddl del .\ddl\script2.ddl
if exist .\reports\report2.txt del .\reports\report2.txt
if exist .\ddl\script3.ddl del .\ddl\script3.ddl
if exist .\reports\report3.txt del .\reports\report3.txt
::script1
echo connect to DB_NAME user USER_NAME using 'PASSWORD' >> .\ddl\script1.ddl
echo select * from TABLE_1 >> .\ddl\script1.ddl
echo terminate >> .\ddl\script1.ddl
db2cmd /c db2 -f .\ddl\script1.ddl -z .\reports\report1.txt
::script2
echo connect to DB_NAME user USER_NAME using 'PASSWORD' >> .\ddl\script2.ddl
echo select * from TABLE_2 >> .\ddl\script2.ddl
echo terminate >> .\ddl\script2.ddl
db2cmd /c db2 -f .\ddl\script2.ddl -z .\reports\report2.txt
::script3
echo connect to DB_NAME user USER_NAME using 'PASSWORD' >> .\ddl\script3.ddl
echo select * from TABLE_3 >> .\ddl\script3.ddl
echo terminate >> .\ddl\script3.ddl
db2cmd /c db2 -f .\ddl\script3.ddl -z .\reports\report3.txt
--- Small Sample Passing Arguments ---
echo select orderno, status, %1 from orderheader where %1 like '%%%2%%' >> .\ddl\%0.ddl
TO RUN SCRIPT
find.bat last_name Johnson
Returns orders with Johnson as the last name OR
find.bat product_desc nut
Return all orders with nut as part of order
Like I said, I am new to this and there may be better ways.