Editing data sets

You can open a file and edit the contents using the z/OS® Explorer. You can edit only text Partitioned Data Set (PDS) members or text sequential data sets.

The data set editor is a text editor that you can use to view or edit a data set.

Important: Use the data set editor to open only JCL or job log files of relatively small size, for example a few MB. When a file is downloaded for display in the z/OS Explorer, the file is stored in the Java™ heap, which has a finite size limit. If you attempt to download a large file, for example a system dump data set, this can cause Java OutOfMemoryError messages. If this situation occurs, restart z/OS Explorer and view the file by using ISPF.
When you open a file to edit, z/OS Explorer places a copy of the file in your local workspace. If the file is busy on the host, for zFS files and sequential data sets, z/OS Explorer still takes a copy, but for PDS members, an error message is displayed. It is possible for a file to change after z/OS Explorer took the copy, for example, another user made and saved changes on the host. In this situation, when you save the file, a warning is displayed in the toolbar of the view, and you must choose whether to overwrite the file on the host, or cancel your changes and return to the data set editor.
Note: In the rare situation where a file changes on the host but the change does not affect the date, time, or size information about the file, a warning is not displayed and your changes will overwrite the file on the host. Be aware of this possibility, for example, when you edit sequential data set files, or PDS members that do not have any statistics.
In the Data Set view, click the data set you want to open and perform one of the following actions:
  • Right-click and click Open.
  • Double-click the data set.

The data set opens in the data set editor.

When you first open the file for editing, the file opens in the editor view in the workbench edit area.

The workbench status bar displays more details about the file.

When you edit files, you must be aware of the cursor position. PDS members have a record length of 80 characters, but the editor does not prevent you from entering more than 80 characters in a single line.

To display line numbers in the editor, right-click the gray vertical bar at the left-side of the view, then click Show Line numbers in the menu.

If a file references a data set name, for example DSN=USER290.NEWJCL(OUT), you can open that data set in another editor view. Press the Ctrl key and hover over the name to change the text to a hyperlink that you can click to open the data set in another editor view.

When you change a file, an asterisk is placed in front of the file name in the view tab. The asterisk indicates that the file contents have changed but have not been saved.

You can now edit the file.

Note: The data set editor does not recognize the format of the file that you are editing. If your file contains Job Control Language (JCL) instructions, do not use tab characters, or your job will fail. To ensure that you do not use tab characters, you can use the following steps to change the global settings for all text editors in your application.
  1. Use one of the following methods to open the JCL Editor pane in the Preferences window:
    • Windows and Linux®: Click Window > Preferences > Explorer > JCL Editor.
    • OS X: Click IBM Explorer for z/OS > Preferences > Explorer > JCL Editor.
  2. In the JCL Editor pane, click the Text Editors link.
  3. In the Text Editors pane, select Insert spaces for tabs and click OK.
The following editing actions are available from the Edit menu on the main menu for the workbench, or the right-click menu options in the view:
Table 1. Edit menu actions
Name Function Keyboard shortcut (Windows and Linux) Keyboard shortcut (OS X)
Undo typing Undo the last change in the editor Ctrl+Z cmd+Z
Redo Redo the previous change that was undone Ctrl+Y shift+cmd+Z
Cut Copies the currently selected text or element to the clipboard and removes the element. On elements, the remove is not performed before the clipboard is pasted. Ctrl+X cmd+X
Copy Copies the currently selected text or elements to the clipboard Ctrl+C cmd+C
Paste Paste the current content as text to the editor, or as a sibling or child element to the currently selected element. Ctrl+V cmd+V
Delete Delete the current text or element selection. Delete key Delete key
Find Next Finds the next occurrence of the currently selected text. Ctrl+K cmd+K
Find Previous Finds the previous occurrence of the currently selected text. Ctrl+Shift+K shift+cmd+K
Incremental Find Next Starts the incremental find mode. After invocation, enter the search text. As you type the cursor moves to the character position after the cursor position that matches the text you type. The text you type is shown in the status bar. Ctrl+J cmd+J
Incremental Find Previous Starts the incremental find previous mode. After invocation, enter the search text. As you type the cursor moves to the character position before the cursor position that matches the text you type. Ctrl+Shift+J shift+cmd+J
Show Tooltip Description Not in use None None
Word Completion Proposes word completions for the current string based on all words found in any open editor. Alt+/ ctrl+.
Table 2. View context menu actions
Name Function Keyboard shortcut (Windows and Linux) Keyboard shortcut (OS X)
Undo typing Undo the last change in the editor Ctrl+Z cmd+Z
Revert File Revert the content of the current editor back to the content of the last saved file. Disabled if the editor does not contain unsaved changes.    
Save Save the content of the current editor. Disabled if the editor does not contain unsaved changes. Ctrl+S cmd+S
Show In Not in use Alt+Shift+W  
Cut Copies the currently selected text or element to the clipboard and removes the element. On elements, the remove is not performed before the clipboard is pasted. Ctrl+X cmd+X
Copy Copies the currently selected text or elements to the clipboard Ctrl+C cmd+C
Paste Paste the current content as text to the editor, or as a sibling or child element to the currently selected element. Ctrl+V cmd+V
Shift Right Increments the level of indentation of the currently select lines.    
Shift Left Decrements the level of indentation of the currently select lines.    

When your edits are complete, to save your changes, clicking the Save icon on the z/OS Explorer toolbar.

To close the editor, click the Close icon in the editor tab. If there are any unsaved changes, the Save resource dialog is displayed so that you can choose whether to save your changes.