Get First (GF)

Command title

Get First

Description

This command retrieves the first row from a table and places it in xxxx-ROW-AREA.

COBOL syntax

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

C syntax

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

Parameters

xxxx-ROW-AREA

Explanation

For a non-Hash table, COUNT is set to 1. For hash tables, when the HASH_EMPTIES_RETURNED is N, COUNT is set to the subscript of the first occupied row in the table; otherwise, COUNT is set to 1.

Return value

If the table is empty, FOUND is set to N and ERROR code set to zero.

If the command completes successfully, FOUND is set to Y.

Notes

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

Exceptions

With HASH-EMPTIES-RETURNED set to N, tableBASE suppresses the return of empty rows for tables which have a Hash organization. See Change Status (CS) for additional information on HASH EMPTIES.

See also

Date-sensitive processing

3. FOUND (1 byte)

8. COUNT (fullword binary)