Close Table (CL)

Command title

Close Table

Description

This command removes the definition and contents of a table from the TSR.

COBOL syntax

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

C syntax

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

Parameters

None

Explanation

If the table was open for write, the table will also be released so that other applications may open it for write.

When it is not desirable to remove a table open for write from memory, the RL command provides an alternative.

A CL command issued on the Data Table closes all of the Alternate Indexes as well.

A CL command on an Alternate Index closes the Alternate Index and will also close the Data Table if no commands have been issued to the Data Table itself (rather than through an Alternate Index) since the Data Table was opened implicitly.

Return value

Version 5—returns Error Code 2 when attempting to close a table with an invalid name (all spaces or zeroes).

Version 6 and above—returns Error Code 12 when attempting to close a table with an invalid name (all spaces or zeroes). Error Code 2 is returned if the table is not open.

Notes

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

Exceptions

None

See also

Store Table (ST)

Release Table (RL)