It is possible to swap versions of a subsystem in the following three ways:
Deactivate the old version (STOP-SUBSYSTEM) and activate the new version of the subsystem (START-SUBSYSTEM). Under certain circumstances, this may result in very long subsystem downtimes because the new version is not activated until the old one has been completely deactivated, i.e. when all tasks have cleared their links.
Activate the new version of the subsystem with START-SUBSYSTEM ...,VERSION-PARALLELISM=*EXCHANGE-MODE. From this time onward, no new links to the old version of the subsystem are set up. While the last tasks are clearing their links to the old version of the subsystem, the new version is initialized. This method substantially shortens the period of subsystem unavailability.
Provided they have been defined, the following routines are called one after the other:
the STOPCOM routine of the old version,
the INIT routine of the new version and
the DEINIT routine of the old version.
For some subsystem it is potentially a problem that the DEINIT routine of the old version is running while the new version has already been activated and is running. A subsystem that was defined with VERSION-EXCHANGE=*FORBIDDEN cannot be swapped in as a new version. It can, however, be deactivated (as the old version) in exchange for a new version that has been defined with VERSION-EXCHANGE= *ALLOWED.
The old version remains in the IN-DELETE state until there is no further task connected. If the new version is in the CREATED state, activation of the old subsystem with RESET=*YES is only possible if coexistence was approved for both versions at the time of definition.
Activation of the old version with RESET=*YES is allowed if the new version is in the IN-DELETE state and the old version was not defined with VERSION-EXCHANGE= *FORBIDDEN.
The CLOSE-CTRL routine can be used to switch versions without interrupting subsystem availability.
Provided they have been defined, the following routines are called one after the other:the CLOSE-CTRL routine of the old version,
the INIT routine of the new version,
the STOPCOM routine of the old version and
the DEINIT routine of the old version.
If the initialization routine of the new version does not run correctly, the old version is automatically reactivated and is in the CREATED state (the result of the CLOSE-CTRL routine is reversible), thus avoiding any interruption of subsystem availability.
Version swapping is allowed if a version of the subsystem is in the CREATED state and all other versions of the subsystem that are declared in the catalog are in the NOT-CREATED or LOCKED state.
A version exchange will not be executed if all declared versions of the subsystem are in the NOT-CREATED or LOCKED state. In this case the version that is activated is the one that was specified in the START-SUBSYSTEM command.Example
Subsystem versions SPOOL V04.2.A and V04.3.A are defined with VERSION-EXCHANGE=*ALLOWED.
/SHOW-SUBSYSTEM-STATUS SPOOL,*ALL SUBSYSTEM SPOOL /V04.2.A IS NOT CREATED SUBSYSTEM SPOOL /V04.3.A IS NOT CREATED /START-SUBSYSTEM SPOOL,04.2.A,VERSION-PARAL=*EXCHANGE-MODE,SYNCH=*YES ESM0220 FUNCTION 'CREATE' FOR SUBSYSTEM 'SPOOL /V04.3.A' COMPLETELY PROCESSED ESM0400 'CREATE' OR 'RESUME' SUBSYSTEM 'SPOOL /V04.3.A' WITH 'SYNCHRONOUS=YES' AND 'RESET=NO' ESM0220 FUNCTION 'CREATE' FOR SUBSYSTEM 'SPOOL /V04.3.A' COMPLETELY PROCESSED
If there are one or more versions of the subsystem which are not in the NOT-CREATED or LOCKED state (apart from the version in the CREATED state that is to be
exchanged), the exchange will be rejected, even if all versions allow coexistence.Example
Subsystem versions UTM V06.3, V06.4 and V06.5 are defined with VERSION-COEXISTENCE=*ALLOWED and VERSION-EXCHANGE=*ALLOWED.
/SHOW-SUBSYSTEM-STATUS UTM,*ALL SUBSYSTEM UTM /V06.5 IS NOT RESUMED SUBSYSTEM UTM /V06.5 IS NOT CREATED SUBSYSTEM UTM /V06.5 IS CREATED /START-SUBSYSTEM UTM,06.4,VERSION-PARALLELISM=*EXCHANGE-MODE ESM0206 SOME ACTIONS IN PROGRESS FOR SUBSYSTEM 'UTM/V06.3'. NO FURTHER ACTION ON ANOTHER VERSION POSSIBLE ESM0224 REQUESTED FUNCTION 'CREATE' FOR SUBSYSTEM 'UTM/V06.4' REJECTED
When the old version of the subsystem is replaced with a new one, the syntax file of the new version is also loaded. This means that the syntax of the new version must also recognize and execute commands and statements of the old version, i.e. it must be ensured that the syntax of the new version supports that of the old version.
It is advisable to use the CLOSE-CTRL routine to swap versions only when the new version which is to be activated is also the higher of the two.