Release Table (RL)

Command title

Release Table

Description

When used with a Data Table or Alternate Index that is open for write, the RL command changes the status of the table or index to open for read and releases the LOCK-LATCH if one has been set.

COBOL syntax

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

C syntax

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

Parameters

None

Explanation

RL can be used on any Data Table or Alternate Index with an open for write status.

A table that is released is then available for another application to open for write.

The RL command will not store the table. To store the table, an ST command must be issued before the RL command.

When the Data Table is released, any open Alternate Indexes are also released. An RL on an Alternate Index demotes the Alternate Index to open for read but leaves the Data Table open for write.

Return value

ERROR 0002 occurs when attempting to release a table that is not open.

ERROR 0073 occurs when attempting to release a table that is open for read.

Notes

The RL command should be used at the conclusion of the updating cycle if it is likely that users in other regions will want access to the table. As the table remains in memory it will not have to be loaded when other users begin using it and it is still accessible for read-only access in the region that has done the RL. Not having to reload the table is particularly beneficial with large tables.

RL is effective for temporary tables (return code 0); Version 5 did not allow this (ERROR 0038).

Exceptions

None

See also

9. LOCK-LATCH (8 bytes)