To undo the last installation executed for a supply unit the supply unit is removed from the system (just like during deinstallation). In addition, the original state that existed before installation of the supply unit is restored based on the Undo files saved during installation.
A prerequisite for the Undo function is that a backup including the creation of the Undo files was performed during installation. An Undo file contains the metadata for the deinstallation of a supply unit. It is stored during installation under the SYSSAG work file ID (if not present, then under TSOS) of the target pubset with the following name:
:<catid of the target pubset>:$SYSSAG.IMON.UNDO.<name of the supply unit>
Only one SCI with standard name $TSOS.SYS.IMON.SCI (home pubset or imported pubset) can be processed by the Undo function.
The Undo process is triggered by the IMON function “Edit: Undo” or the UNDO-SUPPLY-UNITS statement. It is divided into two phases:
| Preparation of the Undo function Actual execution |
Preparing the Undo function
Specifies if the actual Undo actions are to be executed after the execution of the preliminary analysis. The preliminary analysis is used to determine if the most important requirements have been fulfilled:
Subsystems that are to be removed must be stopped.
Files whose activation is to be undone and that are not to be reconstructed while the UNDO function is processing must be accessible.
Test mode
The Undo function can also be called in the Test mode (operand EXECUTION= *NO in the UNDO-SUPPLY-UNITS statement or Direct Execution = 2 (No) in the menu mode). In this case only the preliminary analysis is performed and the results are recorded.
Actual execution
The following action are taken in this phase, just like for deinstallation (see "Deinstallation "):
Deactivation of files
Subsystems, syntax and message files that were activated during the corresponding installation are deactivated.
An activated POSIX item is removed from the POSIX system. The POSIX “remove” commands are saved in the $SYSROOT.IMON.ACTIONS.REM file that is automatically executed the next time the POSIX subsystem is started.
Deletion of files
Files that were created during the corresponding installation are deleted.
Cleanup of the SCI
Entries that were created in the SCI during the corresponding installation are removed from the SCI.
In addition, the following actions are taken to restore the original state:
Activation of files
Subsystems, syntax and message files that were deactivated during the corresponding installation are reactivated. In addition, each POSIX product that is removed during installation when adding a new product is restored in the POSIX system. The necessary POSIX “add” commands are stored in the $SYSROOT.IMON.ACTIONS.ADD file that is executed the next time the POSIX subsystem is started.
Reconstruction of files
Files that were changed or deleted during the corresponding installation are reconstructed.
Consistency and error handling
To ensure consistent processing, the Undo function is performed in several steps. Each processing step must execute successfully before the next step can be started.
If an error arises during a processing step, then an error handling routine is initiated:
In interactive mode, processing is stopped and a message requiring confirmation and containing information on how to deal with the error is output. Execution of the Undo function is either aborted, continued while ignoring the error or continued in the Test mode depending on the response from the user.
In procedure or batch mode, the UNDO-SUPPLY-UNITS statement is aborted abnormally when the first error arises.