SETUNDO—Set UNDO Mode

The SETUNDO macro command allows the UNDO function to be turned on or off and retrieves the current UNDO status.

Syntax

Read syntax diagramSkip visual syntax diagramISREDITSETUNDOSTORAGEKEEPRECOVERONOFF
STORAGE
Enables edit changes to be saved in storage.
KEEP
Has the same effect as STORAGE except the UNDO buffers are not cleared when a SAVE is issued.
Note: The effect of KEEP (UNDO buffers not cleared when a SAVE is issued) ceases if SETUNDO is subsequently issued without the KEEP keyword.
RECOVER
Enables edit changes to be saved through the recovery file only. If edit recovery is off, SETUNDO RECOVER turns recovery on.
ON
The same as STORAGE.
OFF
Disables the saving of edit changes in storage. If edit recovery is available, the undo command uses the edit recovery file.

Assignment statement syntax

Read syntax diagramSkip visual syntax diagramISREDIT ( varname)  = SETUNDO
Read syntax diagramSkip visual syntax diagramISREDITSETUNDO =  STORAGEKEEPRECOVERONOFF
varname
The name of a variable containing the setting of the UNDO mode, either OFF, RECOVER, STORAGE, or KEEP.
STORAGE
Enables edit changes to be saved in storage.
KEEP
Has the same effect as STORAGE except the UNDO buffers are not cleared when a SAVE is issued.
Note: The effect of KEEP (UNDO buffers not cleared when a SAVE is issued) ceases if SETUNDO is subsequently issued without the KEEP keyword.
RECOVER
Enables edit changes to be saved through the recovery file only. If edit recovery is off, SETUNDO RECOVER turns recovery on.
ON
Enables edit changes to be saved in storage.
OFF
Disables the saving of edit changes in storage. If edit recovery is available, the undo command uses the edit recovery file.

Description

The SETUNDO macro command enables undo processing. It does not perform the undo function itself. Valid operands are STORAGE, KEEP, RECOVER, ON, or OFF.

If SETUNDO is set on by a macro and was not on already, the UNDO function is enabled for all interactions started from the point SETUNDO was turned on.

Note:
  1. Changes are saved on the undo chain after:
    • SETUNDO STORAGE or SETUNDO KEEP is specified in a macro, and it was previously OFF or REC, or
    • SETUNDO REC is specified in a macro, and it was previously OFF
    It is possible to undo back to a particular point in a macro. This is helpful in debugging edit macros.
  2. If SETUNDO is disabled through the configuration table, the SETUNDO macro command is accepted and returns a zero return code. It does not turn recovery on.
  3. 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.

Return codes

0
Successful completion. SETUNDO was turned on or off, or status remains unchanged because UNDO was already on or off.
20
Severe error. Probably a parameter error (something other than STG, KEEP, REC, or OFF was specified).

Examples

To disable the saving of edit changes in storage:
ISREDIT SETUNDO OFF
To enable the saving of edit changes in storage:
ISREDIT SETUNDO = STORAGE
To store the value of SETUNDO in the variable &SET:
ISREDIT (SET) = SETUNDO