Understanding differences in SETUNDO processing

SETUNDO STORAGE (or SETUNDO KEEP or SETUNDO ON) and SETUNDO RECOVERY work essentially the same way; however, there are some important differences. SETUNDO REC is available only after the edit recovery file is initialized, that is, until the first data change is made. Because SETUNDO STG keeps its record of changes in storage, it does not incur the same performance penalty as using the SETUNDO REC.

SETUNDO STG can start to save editing changes earlier than SETUNDO REC, because even non-data changes, such as setting line labels, adding note lines, and inserting blank lines, cause SETUNDO STG to initialize its record of changes. You can undo these changes using UNDO even if no data changes have been made. When SETUNDO REC is in effect, only changes made after and including the first change to edit data can be undone.

UNDO reverses changes made during a single edit transaction. It is important to note, however, that changes to the profile, such as HEX ON, LEVEL, and CAPS, are not undone separately. A data change followed by one or more profile changes is usually considered a single transaction. For example, if you change the data and then the profile, and then enter UNDO, the data and profile return to their status before the data change. Profile changes usually cannot be undone if they are not preceded by a data change. SETUNDO STG and SETUNDO REC may work slightly differently in this regard. Since SETUNDO STG keeps the record of changes in storage, it is not a substitute for recovery. To recover the edit session after a system failure, you must have recovery on during the edit session. SETUNDO STG and RECOVERY ON can be in effect simultaneously, however, after a system crash and a recovery, no transactions can be undone using SETUNDO STG because the in-storage record will be empty.

If you are running both SETUNDO STG and RECOVERY ON, the UNDO command causes the last change to be backed out using the in-storage record of edit changes, and the recovery data set to be reinitialized. If you issue a SETUNDO REC command, after you use UNDO (from storage), there will be no more transactions to UNDO since the recovery file has been reinitialized.