If an interrupt is generated when a syntax file is being processed with SDF-A, typically as a result of pressing the key or due to the HOLD-PROGRAM or EXECUTE-SYSTEM-CMD statement, it could potentially endanger the integrity of the file. In specially critical situations, the key is ignored.
A syntax file that is only opened for reading (i.e. with OPEN-SYNTAX-FILE ....,MODE= *READ) is not endangered by such interrupts.
Any syntax file that needs to be created or modified must, however, be opened with MODE=*CREATE / *UPDATE. So long as an object is being processed, the occurrence of an interrupt could have an adverse effect on the integrity of the object or even the syntax file. SDF-A issues warnings if there is a risk of losing data when interrupts occur.
SDF-A initiates a write operation to disk only when an object is explicitly closed. This occurs in the case of the following statements:
when CLOSE-CMD-OR-STMT closes the command or statement definition
when OPEN opens a new syntax file, but first saves the syntax file that was open at the time (if present)
when END saves the current syntax file and terminates SDF-A.
Caution!
If an interrupt occurs when the file is being saved, the syntax file may be corrupted or destroyed.
The creation, deletion or modification of a command usually involves multiple write operations, since the command or statement tables also need to be updated. Interrupts should be avoided especially in such cases, since they could otherwise produce inconsistencies between the command/statement tables and the actually present objects. If SDF detects such inconsistencies when activating a syntax file, the syntax file is rejected.
A syntax file that was rejected by SDF can be opened again with SDF-A (with MODE=*UPDATE(...). You will receive message SDA0446 as a warning. You can then check the syntax file, correct it if required, and save it again so that it is no longer rejected by SDF.
The following steps are recommended to prevent potential problems:
As far as possible, you should execute a CLOSE-CMD-OR-STMT before viewing objects with SHOW. This will ensure that no objects are lost if the SHOW output is interrupted with and you do not return immediately to SDF-A with RESUME-PROGRAM.
Do not open syntax files with MODE=*UPDATE(...) unless you really wish to make changes.