Sample callers of utilities stored procedures

You can use the Db2-supplied utilities stored procedures to run Db2 utilities from Db2 application programs by using the SQL CALL statement.

The following utilities stored procedures are supplied with Db2:

  • DSNUTILS (deprecated)
  • DSNUTILU
  • DSNUTILV

When called, the utilities stored procedures perform the following actions:

  1. Dynamically allocates the specified data sets
  2. Creates the utility input stream (SYSIN)
  3. Invokes Db2 utilities (DSNUTILB)
  4. Deletes all rows currently in the created temporary table (SYSIBM.SYSPRINT)
  5. Captures the utility output stream (SYSPRINT)
  6. Puts the output into the created temporary table (SYSIBM.SYSPRINT)

The utilites stored procedures must run as a WLM-managed stored procedure.