Updating a script

You can update a script to change a command line or to add a command line to a script.

Appending a new command

To append a command line to an existing script issue the UPDATE SCRIPT command without the LINE= parameter. The appended command line is assigned a line number of five greater than the last command line number in the command line sequence. For example, if your script ends with line 010, the appended command line is assigned a line number of 015.

The following is an example of the QSTATUS script. The script has lines 001, 005, and 010 as follows:
001 /* This is the QSTATUS script */
005 QUERY STATUS
010 QUERY PROCESS
To append the QUERY SESSION command at the end of the script, issue the following command:
update script qstatus "query session"
The QUERY SESSION command is assigned a command line number of 015 and the updated script is as follows:
001 /* This is the QSTATUS script */
005 QUERY STATUS
010 QUERY PROCESS
015 QUERY SESSION

Replacing an existing command

You can change an existing command line by specifying the LINE= parameter.

Line number 010 in the QSTATUS script contains a QUERY PROCESS command. To replace the QUERY PROCESS command with the QUERY STGPOOL command, specify the LINE= parameter as follows:
update script qstatus "query stgpool" line=10
The QSTATUS script is updated to contain the following lines:
001 /* This is the QSTATUS script */
005 QUERY STATUS
010 QUERY STGPOOL
015 QUERY SESSION

Adding a command and line number

You can change an existing script by adding new lines.

To add the QUERY NODE command as the new line 007 in the QSTATUS script, issue the following command:
update script qstatus "query node" line=7
The QSTATUS script is updated to contain the following lines:
001 /* This is the QSTATUS script */
005 QUERY STATUS
007 QUERY NODE
010 QUERY STGPOOL
015 QUERY SESSION

Deleting a command from a server script

You can delete an individual command line from a script. When you specify a line number, only the corresponding command line is deleted from the script.

For example, to delete the 007 command line from the QSTATUS script, issue the following command:
delete script qstatus line=7