IBM Books

Administration Getting Started


Creating and Saving a Command Script

A command script lets you issue many commands at once, without the need to type and execute each command individually. A command script can be scheduled to run as a job at a time that you specify. From the Command Center, a script file can contain logic in a supported operating system script language, such as REXX, if you precede the operating system commands with an exclamation mark (!).

The following are the high-level steps for creating and saving a command script using the Command Center. The benefit of creating a script in the Command Center instead of the Script Center is that you can execute the script first before saving it into the Script Center. (To create a script in the Script Center, select Script -> New.)

  1. From the Control Center toolbar, click on the Command Center icon. The Command Center opens. You can also start the Command Center from its own icon in the Server Administration folder.

    Figure 27. Command Center


    * Figure SQLK0CPR not displayed.

  2. Click on the Script radio button and enter your commands in the Script page of the Command Center. (If you execute a command now by clicking on the "gears" push button, or by selecting Execute from the Script menu, the results of the command will be displayed on the Results page of the Command Center.)

    The Script page has two modes: interactive and script. In script mode the entry area acts like an editor. Script mode is intended for you to create and edit a script. In interactive mode it acts like a command entry prompt and the command entry is cleared each time you execute a command. Interactive mode is the default.

  3. From the Script menu, select Save as. The Save window opens.

  4. Complete the fields, and select To Script Center. The command script is saved, and will be accessible through the Script Center.

You can edit a script inside the Script Center or outside the Script Center using your own editor. If you run a script outside the Script Center, the results will not be logged in the Journal.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]