UNDO—Reverse Last Edit Interaction

The UNDO primary command allows you to remove the data modifications of a previous interaction.

Note: The SETUNDO command is ignored if UNDO from storage is not enabled by the installer or person who maintains the ISPF product. For information on enabling UNDO from storage, see z/OS ISPF Planning and Customizing.

Syntax

Read syntax diagramSkip visual syntax diagramUNDO

Description

Each time you enter UNDO, it reverses edit interactions, one at a time, in the order in which they have been entered. To use UNDO, you must have either RECOVERY on or SETUNDO on. You can undo only those changes made after RECOVERY or SETUNDO was turned on. SETUNDO and RECOVERY can be specified in your edit profile. You can also use the edit macro command ISREDIT SETUNDO to turn UNDO processing on and off. See SETUNDO—Set UNDO Mode for more information.

RECOVERY is now optional and is not required to run UNDO. Performance improves if the editor is run with SETUNDO STORAGE and RECOVERY OFF. In this mode, non-data changes, such as setting line labels, adding note lines, and inserting blank lines, can be undone by UNDO even if no data changes have been made. With RECOVERY ON, only changes made after (and including) the first change to edit data can be undone.

Note: Changes made by initial edit macros cannot be undone.

See Understanding differences in SETUNDO processing for more information on the differences between SETUNDO RECOVER and SETUNDO STORAGE processing.

Each time you press Enter, an interaction occurs between you and ISPF. If you combine line and primary commands in one entry, ISPF considers this one interaction. Therefore, UNDO would cause all of the commands to be reversed. ISPF also considers running edit macros that contain a combination of macro commands and assignment statements, while entering a combination of edit line and primary commands at the same time, as one interaction.

Profile changes, such as HEX ON, LEVEL, and CAPS, cannot be undone separately. Profile changes are associated with the data change that came before them, and can be undone only when preceded by a data change. The data change and the profile change are undone at the same time. For example, if you make a change to the data, change the version number, set caps off, turn hex on, and then enter UNDO, the version number, caps setting, and hex mode all revert to the way they existed before the data change. The data change is also undone.

Note: UNDO is not accepted if any line commands or data changes are also specified since it would be unclear what is to be undone.

To undo the last changes:

  1. Type on the command line:
    UNDO
  2. Press Enter.
Note: UNDO is reset by SAVE. Once you save your data for the current edit session, you can no longer recover any interactions made before the data was saved.

Failures in recovery processing due to I/O errors no longer terminate the UNDO function if SETUNDO STORAGE is active. When UNDO is processed, the editor scrolls the data all the way to the left.

See Undoing edit interactions for more information.

Examples

You are editing the member shown in Figure 1 and decide to delete all of the lines. You have type the block form of the D (DELETE) command in the line command field.

Figure 1. Member before lines are deleted
Screen dump.

Figure 2 shows the member after the lines have been deleted. However, you have changed your mind and want to put the lines back again. Therefore, type UNDO on the command line.

Figure 2. Member after lines are deleted
Screen dump.

Figure 3 shows the member after UNDO has been entered and the deleted lines have been restored.

Figure 3. Member after lines have been restored
Screen dump.