Fetch by Key (FK)

Command title

Fetch by Key

Description

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

COBOL syntax

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

Parameters

xxxx-ROW-AREA

xxxx-KEY-AREA (optional)

Explanation

This command locates a row that has the same key as the one specified in the xxxx-KEY-AREA parameter. If the xxxx-KEY-AREA parameter is omitted, the key is taken from the key location in the xxxx-ROW-AREA parameter.

If the row is found, FOUND is set to Y, a copy of the row is moved into xxxx-ROW-AREA and COUNT is set to the subscript of the fetched row. If the requested row is not found in the table, FOUND is set to N and the COUNT contains the appropriate subscript for a potential insertion.

Return value

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

Notes

FK can be used in conjunction with Date-Sensitive Processing.

Exceptions

None

See also

Date-sensitive processing

3. FOUND (1 byte)

8. COUNT (fullword binary)