Replace by Count (RC)

Command title

Replace by Count

Description

This command replaces a row that already exists in a table.

COBOL syntax

MOVE 'RC'                   TO xxxx-COMMAND.
CALL 'DK1TCALL' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            xxxx-ROW-AREA.

Parameters

xxxx-ROW-AREA

Explanation

The content of the xxxx-ROW-AREA replaces the indicated row in the table.

Return value

FOUND code is always Y after this operation, unless there is an error.

Error Code 06 subcodes 1 and 2 indicate that the COUNT specified is out of bounds.

Error Code 06 subcode 3 indicates you are trying to replace an empty Hash table entry.

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

Notes

No checking of key sequence is performed using this command. Replace by Count should be used only when the subscript of the row to be replaced is known, usually through a previous successful retrieval.

If Replace by Count is used inappropriately, rows may get out of sequence or you may be replacing unrelated rows, causing unpredictable results. If you cannot ensure exclusive access to the table, via a LOCK-LATCH password in a multiuser environment such as CICS, it is preferable to use a Replace by Key command.

In a multi-tasking or multi-user online environment, results for commands that utilize a count or sequential accessing of table rows may get unexpected results if another task or user is updating or deleting rows in the same table.

Exceptions

RC may not be used to replace empty Hash table entries.

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)