The LMS run can be interrupted by the user or by the program.
User interrupt
The user can interrupt the LMS run by pressing a program interrupt key (e.g. K2).
Continuation of the LMS run can be controlled by the /SEND-MSG command, which may optionally be supplied with an input text. This input text is subsequently interpreted by LMS during interrupt handling. The current function is informed of the type of termination and terminates in the desired way. The possible inputs are described under the DIALOG-CONTROL operand of the MODIFY-LMS-DEFAULTS statement (see "MODIFY-LMS-DEFAULTS").
Further program systems, such as EDT, can be invoked under LMS. These systems may have their own STXIT routines. LMS always sets up its own STXIT management block.
If different systems use different STXIT routines, then the associated management blocks in those systems are linked with those of LMS, or vice versa.
When an event occurs, all the STXIT routines associated with this event are activated, i.e. in addition to the LMS routines the routines of other systems are also executed. This means that the LMS routines are activated even if the interrupt event does not occur in LMS.
A good example of this is the SEND-MSG command. The SEND-MSG command can be used to send messages to LMS and to all other STXIT routines that handle this event.
Note
The SEND-MSG command is handled by all associated STXIT routines of the entire program system, i.e. it can lead to problems if individual program elements react differently to the same message. The program is generally continued in the subsystem in which the event occurred.
LMS interrupt caused by errors
Error handling is also controlled by means of the STXIT routine.
In the case of program termination, line loss, or specification of /START-EXECUTABLE-PROGRAM, /LOAD-EXECUTABLE-PROGRAM, /CANCEL-JOB, /LOGOFF, /CANCEL-PROGRAM, /ABEND, /EXIT-JOB, a check is performed to ensure that the libraries remain consistent.
The following applies to all program termination conditions:
All STXIT routines in LMS are deactivated in order to prevent any incorrect continuation of processing by SEND-MSG.
LMS simulates an END. This causes all open libraries to be closed.
If any libraries are still open at program termination time, these will be closed.