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

180 AppendixA
COBOL Intrinsics
Status Parameter
COMPUTATIONAL item.
lock/unlock
A code in the left byte of halfword 8 of the file table that
indicates whether a CKLOCK or CKUNLOCK has been
performed successfully since the operation specified in
previous operation:
10 CKLOCK successful
11 CKUNLOCK successful
A sample file table definition might be:
WORKING-STORAGE SECTION.
FILE_TABLE.
01 KSAM_FILE.
02 FILENUMBER PIC S9(4) COMP VALUE 0.
02 FILENAME PIC X(8) VALUE "KSAMFILE".
02 I-O-TYPE PIC S9(4) COMP VALUE 0.
02 A-MODE PIC S9(4) COMP VALUE 0.
02 PREV-0P PIC S9(4) COMP VALUE 0.
The file table identifies a file created with the name KSAMFILE as a file to be opened for
sequential input only. The values of I-O-TYPE and A-MODE can be changed following a
call to CKCLOSE for the file.
Status Parameter
The
status
parameter is a two-character item to which the status of the input/output
operation is returned. It is always the second parameter in a KSAM procedure call. The
status
parameter must be defined in the WORKING-STORAGE SECTION of the COBOL
program.
Status
consists of two separate characters: the left character is known as status-key-1,
and the right is known as status-key-2.
/---left character----\/----right character-----\
|----------------------|------------------------|
| | |
| "status-key-1 | "status-key-2" |<---
status
word
|----------------------|------------------------|
Combining status-key-1 with status-key-2, the following values may be returned to the
status
parameter as a whole:
00
Successful completion