Technical data

.
.
.
PROCESS-EXCEPTION.
DISPLAY "Database Exception Condition Report".
DISPLAY " ".
DISPLAY "DB-CONDITION = ", DB-CONDITION
WITH CONVERSION.
DISPLAY "DB-CURRENT-RECORD-NAME = ", DB-CURRENT-RECORD-NAME.
DISPLAY "DB-CURRENT-RECORD-ID = ", DB-CURRENT-RECORD-ID
WITH CONVERSION.
DISPLAY " ".
CALL "DBM$SIGNAL".
STOP RUN.
4.8.2 At End Condition
An at end condition occurs when a program detects the end of a file. The at end
condition may occur as a result of a FETCH or FIND statement execution in
your database program. You use the AT END phrase to specify the action your
program is to take when an at end condition occurs.
The NOT AT END phrase specifes the action your program takes if an AT END
does not occur.
Use the AT END phrase of the FETCH and FIND statements to handle the end
of a collection of records condition. Your program will terminate if: ( 1 ) an at end
condition occurs, ( 2 ) the program does not include the AT END phrase, and ( 3 )
there is no applicable USE statement.
When an at end condition occurs and the statement contains an AT END phrase:
1. The imperative statement associated with the AT END phrase, if specified,
executes.
2. The NOT AT END phrase, if specified, is ignored.
3. Control is transferred to the end of the I/O statement unless control has been
transferred by executing the imperative statement of the AT END phrase.
When an at end condition occurs and the statement does not contain an AT END
phrase:
1. If the at end condition is associated with a FETCH or FIND statement, an
applicable USE FOR DB-EXCEPTION procedure, if specified, executes. If the
AT END phrase or USE FOR DB-EXCEPTION procedure is not specified, the
run unit terminates abnormally.
2. If the at end condition is associated with a FETCH or FIND statement,
DB-CONDITION is set to DBM$_END.
3. The NOT AT END phrase, if specified, is ignored.
When an at end condition (or any other error condition) does not occur:
1. The AT END phrase, if specified, is ignored.
2. The imperative statement associated with the NOT AT END phrase, if
specified, is executed.
3. Control is transferred to the end of the I/O statement unless control has
been transferred by executing the imperative statement of the NOT AT END
phrase.
Procedure Division 4–17