DB2 Version 9.7 for Linux, UNIX, and Windows

RUNCMD command

Executes a specified command from the CLP interactive mode command history.

Scope

This command can only be run within CLP interactive mode. Specifically, it cannot be run from the CLP command mode or the CLP batch mode.

Authorization

None

Required connection

The required connection will depend on the command being executed.

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-+-RUNCMD-+--+-----+-----------------------------------------><
   '-R------'  '-num-'   

Command parameters

num
If num is positive, executes the command corresponding to num in the command history. If num is negative, executes the command corresponding to num, counting backwards from the most recent command in the command history. Zero is not a valid value for num. If this parameter is not specified, executes the most recently run command. (This is equivalent to specifying a value of -1 for num).

Usage notes

  1. Typically, you would execute the HISTORY command to see a list of recently executed commands and then execute the RUNCMD to execute a command from this list.
  2. The RUNCMD command is not recorded in the command history, but the command executed by the RUNCMD command is recorded in the command history.