Marist, TSO, and ISPF Guide

Table of Contents


Notice: Use of undefined constant section - assumed 'section' in /home/data/www/t90jfl1/public_html/benson_tso_guide/guide.php on line 31

4 Editing a Data Set

This explains how to access and edit a data set. Details of the ISPF text editor are also explained.

4.1 Accessing the Data Set

Before you can start typing code, you must bring up the data set you wish to work on in ISPF. There are several different ways to do this.

4.1.1 Accessing with the Edit Option

If you know the name of the file you would like to edit, you can go to option 2 on the ISPF main screen. This will bring up the Edit Entry Panel

screen shot of edit entry panel (open a data set)

Type in the name of the data set you wish to access in the appropriate fields. Then press enter.

empty data set in editor

A screen containing your data set will appear. If this is the first time you have accessed the data set, it will be blank, like in the image above. View 4.2 Editing the Data Set for more information.

4.1.2 Accessing with Data Set Listing

See the section on listing all available data sets for a user to get a listing of your files.

editing a data set using the data set list utility

Type the letter e next to the data set you wish to edit. Press enter.

confirmation message to edit a data set using the data set list utility

You may see a confirmation screen like the one above. Press enter on this screen to edit your data set.

editting the empty data set

A screen containing your data set will appear. If this is the first time you have accessed the data set, it will be blank, like in the image above. View 4.2 Editing the Data Set for more information.

4.2 Editing the Data Set

4.2.1 Using the ISPF Text Editor

Using the above steps you can open the data set to be edited. Use the tab key to position the cursor to the start of the text area.

editing the empty data set with cursor on first line in editor

You may now begin typing the text into your data set. The arrow keys can move your cursor around, and the tab key can be used to move between lines. As you type it is best to use the tab key or arrow keys to move to new lines.

The use of the Enter key may be confusing to some. If enter is pressed while typing with the blue dots on the side, it will truncate the document to lines with only text on them. If enter is pressed while on the last line of inserted lines (more on that later), it will insert another line to be used. Finally, if enter is pressed at the end of the document, it will scroll the page down by one line.

To quickly move across large documents, use the page down and page up keys. F7 and F8 will do the same functions as page up and page down.

The editor will automatically remove lines without any text on them to save space.

As you type lines of text in the document, the blue dots on the side will be removed and be replaced by line numbers.

Inserting text on the same line - If you want to add more text in between existing letters, first press the Insert key. Without pressing enter, the editor will use the default option, which is to overwrite existing text.

Deleting text - By default, the backspace button doesn't remove letters. It will move the cursor position back by one space. Now, if you type, the letters will be overwritten. To just remove a character, position the cursor over the character to be removed and press the Delete button.

4.2.2 Saving the Data Set

To save a data set, type the command "save" in the command bar in the editor.

data set saved confirmation box

The above message will appear in the upper right corner of the screen when you save a data set.

Also, the data set will be saved when you exit the editor.

4.2.3 Exiting the Text Editor

To leave the ISPF text editor, type "exit" in the command line. Another way to exit is to press the F3 key. Both options will return you to the previous screen. ISPF will automatically save your document when you exit.

4.3 Line Options

Once you have text in your data set, you may need to change it. There are several different ways a user can do this.

4.3.1 Inserting Lines

If you have a data set full of text, you may need to insert new, blank lines between existing lines of text.

example on how to insert lines in editor

Above we have a data set filled with Robert Frost's classic poem The Road Not Taken. Suppose you want to insert a line of text between the second and third lines. Type the letter "I" in the row above the location to insert the lines, in the section listing the line numbers. Then press enter.

result of inserting one line in editor

Notice how there is a blank line with blue dots to the left. This is the new line that has been entered. Type your text in the main content area. If you press the enter key after typing text, another line will be inserted. If you press the enter key on a blank line, any unused lines will be removed from the editor.

It is also possible to insert multiple lines at once. Instead of typing "I", type "I" and then the number of lines to insert. For example, "I5" will insert five lines of text below the current cursor position.

4.3.2 Deleting Lines of Text

The process to remove a line of text is very similar to adding a line of text. In the column listing the row numbers, type the letter "D" on the line of text you wish to delete. If you press enter, it will delete that line of text. Also, you can specify multiple lines to be deleted by typing "D" and then a number. For example, "D3" will delete 3 lines of text.

4.3.3 Deleting Blocks of Text

Deleting blocks of text. By typing DD on two different lines, all text on those lines and between those lines will be deleted.

deleting a block of text using the ispf editor

For example, suppose we want to remove the second verse from the poem above. Type DD on the starting and ending positions of the lines you wish to remove and press enter to remove the section of text.

result of deleting a box of text in ispf editor

4.3.4 Copying and Moving Text

Like with insert, "C" and "M" can both be used to move text. Multiple lines can also be processed. For example, "C5" or "M5" will both process 5 lines. Also, the letters "A" or "B" must be specified elsewhere in your document. These will determine if the text should come after or before the line with the "A" or "B" on it. Press enter to process the text.

copying multiple lines of text in ispf editor

In the above example, the first paragraph will be copied after the second paragraph

result of copying multiple lines of text in ispf editor

4.3.5 Copying and Moving Blocks of Text

Blocks of text can also be copied or moved using the same syntax as with deleting a box of text.

To copy a block of lines place the text "CC" on the line to both start and end the copy. Then, place a letter "A" or "B" on the line where the text will be placed after or before. Then press enter to process the entire block of text.

To move a block of lines, follow the same instructions for copying a block of lines, except use ""MM" instead of "CC".

4.3.6 The Find Command

In the command line, if you type "FIND STRING" and press enter, ISPF will do a search for STRING in your data set. In our poem above, if we do "FIND AND" it will move the cursor position to the second line. Now, if the F5 button is pressed, the search will process again until the next time "AND" is found. This happens to be on the third line of the text. If the search term is not found, a message will display in the upper right corner of the screen.

4.3.7 The Change Command

Similar to the find command is the change command. In the command line, type "CHANGE SEARCH REPLACE" and press enter. Whenever ISPF finds the text "SEARCH" it will be swapped with the text "REPLACE". This normally only changes the first occurrence of "SEARCH". If you run the command "CHANGE SEARCH REPLACE ALL" it will change every "SEARCH" string into a "REPLACE" string throughout the document. If the search term is not found, a message will display in the upper right corner of the screen.