Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Uninterruptibility

&pagelevel(3)&pagelevel

Protecting procedures and programs from being interrupted

By setting the operand value INTERRUPT-ALLOWED=*NO in SET-PROCEDURE-OPTIONS or in MODIFY-PROCEDURE-OPTIONS, a procedure can be protected against interruptions by commands input in dialog mode.

If a program is activated in a procedure, the procedure must also be protected against uncontrolled command inputs; e.g. if the program is processing data or statements, and some of these request the program to execute commands (CMD macro) or to issue an interrupt (BKPT) which is not provided for in the procedure.

Example

/SET-PROCEDURE-OPTIONS ...,INTERRUPT-ALLOWED=NO
/ASSIGN-SYSDTA TO=*PRIMARY
/START-LMS
                       ----------> Dialog at the terminal:
                                           //
                                           //...
                                           //END
/MODIFY-JOB-SWITCHES ON=(4,5)
/START-EDT
                       ----------> Dialog at the terminal:
                                            *
                                              * ...
                                            *
/EXIT-PROC

If a procedure is protected against interruption, then normally any program which is executed in this procedure is also protected against interruption by the key. However, if a STXIT routine is defined in the program for  interruptions (ESCPBRK), then the  event is passed to this STXIT routine. Responsibility for handling this event then lies with the program. This will in any case lead to problems, if the program reacts with a BKPT macro.

Example

/SET-PROCEDURE-OPTIONS ...,INTERRUPT-ALLOWED=NO
/START-EXECUTABLE-PROGRAM ... 
//
//...           <--------------[K2]
[K2]-STXIT>  Output PC                  
                      BKPT
                      “Return to the command level”
/EXIT-PROCEDURE