Use this command to display information about scripts. You can use this command in conjunction with the DEFINE SCRIPT command to create a new script using the contents from another script.
Privilege Class
An administrator can issue this command unless it includes the OUTPUTFILE parameter. If the OUTPUTFILE parameter is specified and the REQSYSAUTHOUTFILE server option is set to YES, the administrator must have system privilege. If the OUTPUTFILE parameter is specified and the REQSYSAUTHOUTFILE server option is set to NO, the administrator must have operator, policy, storage or system privilege.
Syntax
.-*-----------. >>-Query SCRipt----+-------------+------------------------------> '-script_name-' .-FORMAT--=--Standard-----. >-----+-------------------------+-------------------------------> '-FORMAT--=--+-Standard-+-' +-Lines----+ +-Detailed-+ '-Raw------' >-----+---------------------------+---------------------------->< '-Outputfile--=--file_name--'
Parameters
Attention: If you do not specify a script, the query displays information about all scripts. The time used to process this command and the amount of information displayed can be extensive.
Examples
Task 1
Display the standard information about scripts.
+--------------------------------------------------------------------------------+ |Name Description | |--------------- ------------------------------------------------------ | |QCOLS Display columns for a specified SQL table | |QSAMPLE Sample SQL Query | |EXAMPLE Backup the store pools and database when no sessions | | | | | +--------------------------------------------------------------------------------+
Task 2
Display the lines information for a script named Q_AUTHORITY.
+--------------------------------------------------------------------------------+ |Name Line Command | | Number | |---------- ------ -------------------------------------------------- | |Q_AUTHORITY 1 /* ------------------------------------------*/ | | 5 /* Script Name: Q_AUTHORITY */ | | 10 /* Description: Display administrators that */ | | 15 /* have the authority to issue */ | | 20 /* commands requiring a */ | | 25 /* specific privilege. */ | | 30 /* Parameter 1: privilege name - in the form */ | | 35 /* x_priv - EX. policy_priv */ | | 40 /* Example: run q_authority storage_priv */ | | 45 /* ------------------------------------------*/ | | 50 select admin_name from admins where - | | 55 upper(system_priv) <> 'NO' or - | | 60 upper($1) <> 'NO' | +--------------------------------------------------------------------------------+
Task 3
Display detailed information about scripts.
+--------------------------------------------------------------------------------+ | Name: QCOLS | | Line Number: DESCRIPTION | | Command: Display columns for a specified SQL table | |Last Update by (administrator): SERVER_CONSOLE | | Last Update Date/Time: 12/02/1997 16:05:29 | | | | Name: QCOLS | | Line Number: 1 | | Command: select colname from columns where | | tabname='$1' | |Last Update by (administrator): SERVER_CONSOLE | | Last Update Date/Time: 12/02/1997 16:05:29 | +--------------------------------------------------------------------------------+
where:
Task 4
Query the ENGDEV script and direct the output to a file named MY.SCRIPT.
Task 5
Create a new script by using the contents from file, MY.SCRIPT. Name the new script AGADM.
Related Commands
Table 187. Commands Related to QUERY SCRIPT
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. |
RENAME SCRIPT | Renames a script to a new name. |
RUN | Runs a script. |
UPDATE SCRIPT | Changes or adds lines to a script. |