Writing Real Programs in DCL, Second Edition

AN INTERRUPT IS CAUSED BY AN EVENT requiring immediate attention when it occurs. If a program is executing when an interrupt takes place, program execution must be suspended so that the event can be handled as soon as possible. Once interrupt handling is complete, program execution is resumed at the point of suspension. DCL procedures need only deal with one kind of interrupt, that which occurs when the CTRL/Y key is pressed. The CTRL/Y key is the means by which the Open VMS user signals that program execution is to be temporarily suspended or permanently canceled.
There are two situations in which a CTRL/Y interrupt can occur during procedure execution. The first is while DCL is interpreting the command lines in the procedure. In this situation, both the CTRL/Y and the CTRL/C keys generate an interrupt: the two keys are equivalent. The second situation is during the execution of a program image invoked by a command in the procedure (e.g., the COPY command invokes the COPY.EXE image). In this situation, the CTRL/Y key generates an interrupt. Whether the CTRL/C key is equivalent to CTRL/Y depends on how the program image handles CTRL/C. If the image explicitly requests special handling of CTRL/C, then that key will not generate a CTRL/Y interrupt.
Regardless of the circumstance under which a CTRL/Y interrupt occurs, it is handled in a consistent fashion by DCL. The remainder of this chapter presents the various methods of handling interrupts.