Changing data structures by using DML
The CM/PILOT DML_STRUCTURE_CHG script contains the steps to create an Analysis worklist to update and delete data structures on a local Db2 subsystem.
You can use DML to specify the changes to the data structures. The script uses a DML trigger to determine whether data structures exist. The DML trigger is the SEARCH condition of a DML WHERE clause. If no data structures are found, the CM/PILOT worklist processing stops, and an Analysis worklist is not created. If data structures are found, an Analysis worklist is created to apply the changes.
In this task, you perform the following subtasks:
- Create a task ID.
- Create a DML statement.
- Execute the task ID.
To create a task ID
- On the BMC AMI Change Manager for Db2 Main Menu, select CM/PILOT, and press Enter.
- On the CM/PILOT Main Menu, select TASKIDs and press Enter.
- On the TASKID Action Menu, type the name of a new TASKID and select Create a TASKID. Then, press Enter.
- On the Script Selection List, select Change data structures using a DML trigger and press Enter.
- On the Create TASKID panel, specify the information for a task ID.
- CM/PILOT uses the name of the task ID as the name for a new alter-type work ID. You can type a different name for WORKID or type the name of a work ID name template.
- (Optional) Type the name of a CM/PILOT Application. An Application groups a set of BMC AMI Change Manager for Db2 profiles. For more information about Applications, see Using-scripting-tools-to-automate-change-management.
- (Optional) Specify a Comment to describe the task ID.
- Type S to select Create or Edit DML.
- Press Enter.
To create the DML statement
- On the Select Object and Action for Change DML panel, specify the information to create a DML statement.
- Select an Object type to be included in a DML statement.
Select an Action.
- Press Enter.The panel that is displayed is based on the object and the action that you select.
Type a value for an attribute for the SET clause. Then, type an operator and a value for the WHERE clause and press END.The DML statement is displayed in the ISPF Editor, as shown in the following example.
UPDATE DATABASE SET
NAME = 'DEMOCJ'
WHERE
NAME = 'DEMOME'
;
- Edit your DML statement in the ISPF Editor, if necessary.
For information about DML syntax, see CM-PILOT-Data-Manipulation-Language-DML. - When you have finished editing the statement, press END.
On the List DML Statements panel, you can perform the following actions by typing the action code adjacent to the DML statement:
Action code
Action
Description
A
Add a new statement
Displays the Select Object and Action for Change DML panel, so that you can create another DML statement. The new statement is placed at the end of the list.
B
Browse
Displays the ISPF Editor and places you in browse mode. After you browse the statement, press END.
C
Copy
Copies the DML statement and displays the ISPF Editor. After you modify the statement, press END. The copied and modified statement is located at the end of the list.
D
Delete
Deletes a DML statement. The statement is immediately deleted; no delete confirmation panel is displayed.
E
Edit
Displays the ISPF Editor.
- When you have finished modifying the DML statements, press END until the TASKID Action Menu is displayed.
To execute the task ID
- On the TASKID Action Menu, select Execute a TASKID and press Enter.The TASKID Interface panel is displayed.
- On the TASKID Interface panel, specify the data set names to be used by CM/PILOT.
- Type the data set name for the CM/PILOT Worklist.
- Type the data set name for the CM/PILOT JCL.
- Type the data set name for Diagnostics or type SYSOUT.
- Select the method of executing the CM/PILOT worklist.For more information about executing a CM/PILOT worklist, see Processing-CM-PILOT-worklists.
- (Optional) Override the options that are set in Change Manager.
Type S to select Override
Change Manager
options and then press Enter.
On the Override Change Manager Options panel, select Override
Change Manager
Options.
Type S to select the Change Manager Analysis and Execution options that you want to override, and press Enter.For more information about overriding the options, see Using-options-to-control-your-environment.
- Press END until the TASKID Interface panel is displayed.
- On the TASKID Interface panel, create a CM/PILOT worklist.
- Type S to select Create Worklist. Then, press Enter.
- On the Step Settings panel, type S to select the steps in the script that you want to modify, and press Enter.
- To display subsequent Step Settings panels, press Enter.After the Step Settings panels are displayed, the Change Manager Datasets panel is displayed.
- Specify the data set names to be used by the Analysis and Execution components of Change Manager. Then, press END until the TASKID Interface panel is displayed.
On the TASKID Interface panel, select your options for processing the CM/PILOT worklist.
Goal
Action
To edit the CM/PILOT worklist
Type S to select Edit Worklist.
To create the JCL to run the worklist
Type S to select Create JCL
To review or modify the JCL
Type S to select Edit JCL
To submit the JCL to run the CM/PILOT worklist
Type S to select Submit JCL.
- Press Enter.CM/PILOT creates an Analysis worklist and the Execution JCL that is required to run the worklist.
To change your data structures, execute the Analysis worklist.