Execute Commands Inside DB2 Procedures

I was looking for a way to call DB2 runstats, a non-SQL command, from inside a store procedure.
It turns out that it is actually quite easy. All one has to do is to use the ADMIN_CMD procedure from the SYSPROC schema.

ADMIN_CMD is used by applications to run DB2 command line processor administrative commands using the SQL CALL statement.

Here's how to do it: ADMIN_CMD

./M6