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
Possible values are:
Possible values are:
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.
+--------------------------------------------------------------------------------+ |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.
+--------------------------------------------------------------------------------+ |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.
+--------------------------------------------------------------------------------+ |COLNAME | |------------------ | |DATE_TIME | |MSGNO | |SEVERITY | |MESSAGE | |ORIGINATOR | |NODENAME | |OWNERNAME | |SCHEDNAME | |DOMAINNAME | |SESSID | | | |ANR1462I RUN: Command script QSAMPLE completed successfully. | +--------------------------------------------------------------------------------+
Related Commands
Table 235. 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. |