The statements @HALT, @RETURN (outside of procedures), @EXEC and @LOAD and, in F mode, the [K1] key terminate EDT normally. When this is done, EDT closes all open files.
In interactive mode, it may also be possible to terminate EDT with @END. In L mode, the messages
% EDT4939 '@END' WITHOUT '@PROC' STATEMENT
% EDT0904 TERMINATE EDT? REPLY (Y=YES; N=NO)?
are first output to prevent any unintentional termination of EDT.
If EDT is running a screen dialog (after @DIALOG), then the statements @HALT, @RETURN (outside of procedures), @END and the [K1] key terminate the screen dialog but not EDT itself. In this case, the user is not asked to confirm.
@HALT ABNORMAL can be used to force an abnormal termination of the EDT session if EDT was started as a main program. If EDT was started as a subroutine, @HALT ABNORMAL returns control to the calling program and issues a special return code.
If there are any unsaved work files when termination is requested, EDT is not immediately terminated if it is running in interactive mode. After the message
% EDT0900 EDITED FILE(S) NOT SAVED!
the numbers of the work files containing unsaved data are output. The user then sees the following query:
% EDT0904 TERMINATE EDT? REPLY (Y=YES; N=NO)?
If the user replies N
, the EDT session continues and the user can resume work, for example by writing back as yet unsaved files. If the user replies Y
the unsaved work files are lost and EDT is terminated.
In F mode, if EDT is terminated with the [K1] key then the confirmation query
% EDT0904 TERMINATE EDT? REPLY (Y=YES; N=NO)?
is output in the work window's message line even if there are no open work files.
When EDT is terminated, the content of the string variables #S00..#S20
is assigned to the corresponding S variables SYSEDT-S00..SYSEDT-S20
if these exist and if they are able to accept a value of type STRING
. The values of the string variables are passed in the character set EDF041
. If conversion errors occur, the value is not transferred. If the value is more than 4096 bytes long then it is truncated and only the first 4096 bytes are transferred. No messages are output. This assignment step is omitted if it has already been performed manually using @SETVAR with the KEEP
operand or if EDT was started as a subroutine.
If the event Program runtime exceeded occurs (EDT runtime exceeds the value specified for CPU-LIMIT
in the /START-PROGRAM
command), then a message is output to SYSOUT
and EDT is terminated abnormally if it is running in batch mode.
If the interrupt event PROCHK
(program error) or ERROR
(unrecoverable program error) occurs and the EDT data area is still addressable then message EDT8910
is output and specifies the program counter and interrupt weight. A memory dump is generated and EDT is terminated abnormally.
To control system procedures in which EDT is called, information about the cause of EDT termination and about the EDT session is provided both in the event of normal termination with @HALT, @RETURN (in interactive mode, also with @END), or abnormal termination brought about by the system or by the user with @HALT ABNORMAL.
This information is not available if the EDT session is aborted with the @EXEC or @LOAD statements or with the BS2000 /CANCEL-PROGRAM
command or if EDT is unloaded by means of another BS2000 command.