Delete by Key (DK)

Command title

Delete by Key

Description

This command deletes a row from a table and places it in xxxx-ROW-AREA.

COBOL syntax

MOVE 'DK'                   TO xxxx-COMMAND.
CALL 'DK1TCALL' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            xxxx-ROW-AREA
                            [xxxx-KEY-AREA].

Parameters

xxxx-ROW-AREA

xxxx-KEY-AREA — If xxxx-KEY-AREA is omitted, the table key is extracted from xxxx-ROW-AREA.

Explanation

DK searches the table for a row with a key matching the one specified; if found, the row is deleted. The deleted row is moved into xxxx-ROW-AREA for verification.

The ROW-OVERRIDE-LENGTH can be used to indicate how many bytes of the row are moved into xxxx-ROW-AREA.

Return value

If the row is found, COUNT is set to the subscript of the deleted row and FOUND is set to Y.

If the requested row is not found in the table, COUNT will contain the appropriate subscript for a potential insertion and FOUND is set to N.

The table must be open for write in the TSR or VTS-TSR. Multiple error codes can be returned by this command.

Notes

None

Exceptions

For a single batch program using a local TSR, the table can be open for read.

See also

3. FOUND (1 byte)

8. COUNT (fullword binary)