Fetch by Count (FC)

Command title

Fetch by Count

Description

This command fetches a row from a table using the subscript specified in the COUNT field of xxxx-COMMAND-AREA and places it in xxxx-ROW-AREA.

COBOL syntax

MOVE 'FC'                   TO xxxx-COMMAND.
CALL 'TBLBASE' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            xxxx-ROW-AREA.

C syntax

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

Parameters

xxxx-ROW-AREA

Explanation

None

Return value

On a successful retrieval, a copy of the row is moved into xxxx-ROW-AREA and the FOUND field is set to Y.

An FC with a negative or zero COUNT, or a COUNT higher than the number of rows in the table, returns with the FOUND field set to N and ERROR code set to zero.

Notes

The HASH-EMPTIES-RETURNED switch setting has no effect on the FC command. Empty rows as well as populated rows are returned to the application. The user program must check for an empty row by examining the key portion of xxxx-ROW-AREA for low values.

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

Exceptions

None

See also

Date-sensitive processing

3. FOUND (1 byte)

8. COUNT (fullword binary)