Tivoli Storage Manager for Windows Administrator's Reference

RUN (Run a Tivoli Storage Manager Script)

Use this command to run a TSM script. To issue this command on another server, the script being run must be defined on that server.

You can include RUN commands in scripts as long as they do not create loops. For example, you should avoid including RUN commands where SCRIPT_A runs SCRIPT_B and SCRIPT_B runs SCRIPT_A.

Privilege Class

To issue this command, you must have operator, policy, system, storage, or system privilege.

Syntax

>>-RUn--script_name----+----------------------------+----------->
                       |  .-,--------------------.  |
                       |  V                      |  |
                       '----substitution_value---+--'
 
      .-Preview--=--No------.   .-Verbose--=--No------.
>-----+---------------------+---+---------------------+--------><
      '-Preview--=--+-No--+-'   '-Verbose--=--+-No--+-'
                    '-Yes-'                   '-Yes-'
 

Parameters

script_name (Required)
Specifies the name of the script you want processed. The name you specify cannot be a substitution variable, such as $1.

substitution_value
Specifies one or more values to substitute for variables when the script is run. In a script, a substitution variable consists of a '$' character, followed by a number. When you run the script, TSM replaces the substitution variables defined in a script with the values you supply with this command. You must specify values for each substitution variable defined in the script or the script will fail. This parameter is optional.

Preview
Specifies whether to preview the command lines of a script without actually processing the script. The default is NO.

Possible values are:

Yes
Specifies that the command lines included in a script are displayed, but the script is not processed.

No
Specifies that the command lines included in a script are displayed and the script is processed.

Verbose
Specifies whether command lines, variable substitution, and conditional logic testing used in a script are displayed as the script is being processed. This parameter is ignored if PREVIEW=YES is specified. The default is NO.

Possible values are:

Yes
Specifies that the command lines, variable substitution, and conditional logic testing are displayed as the script is being processed.

No
Specifies that the command lines, variable substitution, and conditional logic testing do not display as the script is being processed.

Examples

Task 1

Assume that you have defined a script called QSAMPLE to include the following lines:

001  /* This is a sample SQL Query in wide format */
005  SET SQLDISPLAYMODE WIDE
010  SELECT colname FROM -
015  COLUMNS WHERE TABNAME='$1'

Preview the commands in the QSAMPLE script before running the script. Specify ACTLOG as the value for the substitution variable, $1.

Command:
run qsample actlog preview=yes
+--------------------------------------------------------------------------------+
|ANR1461I RUN: Executing command script QSAMPLE.                                 |
|ANR1466I RUN: Command script QSAMPLE, Line 5 : set sqldisplaymode wide.         |
|ANR1466I RUN: Command script QSAMPLE, Line 15 :                                 |
|              select colname from columns where tabname='ACTLOG'.               |
|ANR1470I RUN: Command script QSAMPLE completed successfully (PREVIEW mode)      |
+--------------------------------------------------------------------------------+

Task 2

Run the script to display column names for the ACTLOG table.

Command:
run qsample actlog verbose=yes
+--------------------------------------------------------------------------------+
|ANR1461I RUN: Executing command script QSAMPLE.                                 |
|ANR1466I RUN: Command script QSAMPLE, Line 5 : set sqldisplaymode wide.         |
|ANR1466I RUN: Command script QSAMPLE, Line 5 : RC=RC_OK                         |
|ANR1466I RUN: Command script QSAMPLE, Line 15 :                                 |
|              select colname from columns where tabname='ACTLOG'.               |
|                                                                                |
|COLNAME                                                                         |
|------------------                                                              |
|DATE_TIME                                                                       |
|MSGNO                                                                           |
|SEVERITY                                                                        |
|MESSAGE                                                                         |
|ORIGINATOR                                                                      |
|NODENAME                                                                        |
|OWNERNAME                                                                       |
|SCHEDNAME                                                                       |
|DOMAINNAME                                                                      |
|SESSID                                                                          |
|                                                                                |
|ANR1462I RUN: Command script QSAMPLE, Line 15 : RC=RC_OK                        |
|ANR1462I RUN: Command script QSAMPLE completed successfully.                    |
+--------------------------------------------------------------------------------+

Run the same command without displaying the individual command lines.

Command:
run qsample actlog verbose=no
+--------------------------------------------------------------------------------+
|COLNAME                                                                         |
|------------------                                                              |
|DATE_TIME                                                                       |
|MSGNO                                                                           |
|SEVERITY                                                                        |
|MESSAGE                                                                         |
|ORIGINATOR                                                                      |
|NODENAME                                                                        |
|OWNERNAME                                                                       |
|SCHEDNAME                                                                       |
|DOMAINNAME                                                                      |
|SESSID                                                                          |
|                                                                                |
|ANR1462I RUN: Command script QSAMPLE completed successfully.                    |
+--------------------------------------------------------------------------------+

Related Commands

Table 233. Commands Related to RUN

Command Description
COPY SCRIPT Creates a copy of a script.
DEFINE SCRIPT Defines a script to the TSM server.
DELETE SCRIPT Deletes the script or individual lines from the script.
QUERY SCRIPT Displays information about scripts.
RENAME SCRIPT Renames a script to a new name.
UPDATE SCRIPT Changes or adds lines to a script.


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