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 'TBLBASE' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            xxxx-ROW-AREA
                            [xxxx-KEY-AREA].

C syntax

memcpy( tbCommArea.tbCommand, "DK", 2 );
TBLBASE( &tbParm, &tbCommArea, pRowArea, pKeyArea );

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.

Notes

None

Exceptions

None

See also

3. FOUND (1 byte)

8. COUNT (fullword binary)