Using KSAM/XL and KSAM 64 (32650-90886)

182 AppendixA
COBOL Intrinsics
Status Parameter
The value of
status
can be tested as a whole, or the two characters can be tested
separately as
status-key-1
and
status-key-2
. In any case, the status of each call should
be tested immediately following execution of the call. Unless the first character of
status
= 0, the call was not successful.
For example, a sample
status
parameter definition might be:
WORKING-STORAGE SECTION.
.
.
.
01 STAT.
02 STATUS-KEY-1 PIC X.
02 STATUS-KEY-2 PIC X.
These items can then be referenced in the PROCEDURE DIVISION. For example: to test
only the first character:
IF STATUS-KEY-1 NOT = "0" THEN
GO TO "ERROR-ROUTINE".
To test the entire status word:
IF STAT = "23" THEN
DISPLAY "RECORD NOT FOUND".
Note that the word
STATUS
is reserved.