When issuing the "db2 connect to ..." command, this returns a line of the form
Code:
Database server = DB2/6000 7.1.9
or something like that.
So first parse this output before proceeding with a subsequent "db2 drop database ..."
(I'm assuming that your "db2 ..." commands are put in a script.)