Editing text files in Scratchpad
Use the following procedure to edit a text file (such as a command statement) that is opened in Scratchpad.
Related topic
To edit a file
New console
- To open the text file in the Scratchpad perspective, perform one of the following actions:
- In the Scratchpad perspective, open an existing file displayed under Files.
- To create a new command file, add a new file view by clicking
. Then, on the Command Text tab in Scratchpad, enter the command text (either by typing it or pasting copied text).
- Select an object or group of objects in the Db2 navigation perspective, and select one of the Commands options, such as DDL.
- Double-click a data set in the File Locator perspective.
On the Scratchpad's Command Text tab, edit the command as needed:
Purpose
Action
Find a search string
- Click Find/Replace
- Enter the search string in the Search box.
- Click Find.
Find and replace a search string
- Click Find/Replace
.
- Enter the search string in the Search box.
- Enter the replacement string in the Replace box.
- Click Find.
- Click Replace.
Find and replace all instances of a search string
- Click Find/Replace
.
- Enter the search string in the Search box.
- Enter the replacement string in the Replace box.
- Click Replace All .
Make a search case sensitive
Select the Match case check box.
Enable syntax highlighting
Select Use syntax highlighting.
This option is available when the Command Center option is enabled.
For more information, see Setting-Command-Center-options.
Undo an action
Click
to undo the last action.
Redo an action
Click
to cancel undoing the last action.
Copy an existing file
- Browse to a data set and open an existing file.
- Click Copy File
.
Save the file.
Follow the instructions in Step 4.
Note
To remove a file view from the Scratchpad navigation pane, select the file view and click Remove file view
.
- Click Find/Replace
To save the active edited command output, click Save File
in the toolbar.
Under Files in the navigation pane, Scratchpad automatically displays all files that are saved to the mainframe.
- Select a z/OS data set in which to save the file.
- Click Add filter
.
- In the Filter Pattern box, enter a filter (the wildcard * is supported) to display a filtered list of data sets that includes the one you want.
- Click OK.
- In the displayed hierarchical tree, navigate to and select the data set that you want.If you select an archived data set, you will be asked to confirm that you want to restore that data set.
- Click Add filter
- Enter a file name.
- Click Save.
Classic console
- To open the text file in the Scratchpad perspective, perform one of the following actions:
- In the Scratchpad perspective, open an existing file displayed under Files.
- To create a new command file, add a new file view by clicking
. Then, in the Command Text tab in Scratchpad, enter the command text (either by typing it or pasting copied text) .
- Select an object or group of objects in the DB2 navigation perspective, and click one of the command options such as DDL
- Double-click a data set in the File Locator perspective
In the Scratchpad's Command Text tab, edit the command as needed:
To
Do this
Find a search string
Enter the search string in the Search box and click Find.
Find and replace a search string
- Double-click a data set in the File Locator
- Enter the search string in the Search box.
- Enter the replacement string in the Replace box.
- Click Find.
- Click Replace.
Find and replace all instances of a search string
- Enter the search string in the Search box.
- Enter the replacement string in the Replace box.
- Enable the All checkbox.
- Click Replace.
Make a search case sensitive
Select the A/a checkbox.
Undo an action
Click
to undo the last action.
Redo an action
Click
> to cancel undoing the last action.
Enable the editor to accept Regular expressions
Select the RegEx checkbox.
Note
Scratchpad supports all standard Regular expressions.
Copy an existing file
- Browse to a data set and open an existing file.
- Click Copy File
.
Save the file.
Follow the instructions in Step 4.
Note
To remove a file view from the Scratchpad navigator pane, select the file view and click Remove File View
.
Save your changes:
- To save the active edited command output, click Save File
in the toolbar.
To save multiple open files (for example, you selected and created DDL for several objects simultaneously), click Save all files
(in the navigation pane) to open a Save dialog box for each file.
Note
For each file, you can save to a separate data set or select Don't Save.
Under Files in the navigation pane, Scratchpad automatically displays all files that are saved to the mainframe.
- To save the active edited command output, click Save File
- Select a z/OS data set in which to save the file.
- Click Add Data Set Filter.
- In the Filter Pattern box, enter a filter (the wildcard * is supported) to display a filtered list of data sets that includes the one you want.
- In the displayed hierarchical tree, navigate to and select the data set that you want.If you select an archived data set, you will be asked to confirm that you want to restore that data set.
- Enter a file name.
- Click OK.