Generating RUNSTATS for a query

Use the Statistics Advisor tool to generate RUNSTATS for a query.

  1. Open the editor on a program file that contains EXEC SQL statements.
  2. Select the contents of the EXEC SQL statement, and then right-click and select Db2 for z/OS > Tune Selected SQL.
    Tip: In the z Systems® LPEX Editor, use the Db2 menu on the product menu bar.
  3. On the Tuning Actions window, select Statistics Advisor, and then click OK.

    The tuning data is displayed in the Remote System Details view.

  4. To see the output of the action, select it and click Open Results. The Statistics Advisor window opens with recommended RUNSTATS commands and command results.