Store Table (ST)

Command title

Store Table

Description

The ST command stores the table — table data and table definition — to a tableBASE library.

COBOL syntax

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

C syntax

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

Parameters

None

Explanation

The ST command does not close the table. If an ST command addresses an Alternate Index, a new generation of the Data Table is actually stored instead; there is no effect on the Alternate Index itself.

Return value

ERROR 0018 occurs if there is insufficient space in the library.

ERROR 0019 occurs if the table is newly defined using DT or CN and a table with the same name is found in the library during the store.

Notes

tableBASE stores a new generation of a table before it deletes the oldest generation, if appropriate. Even if only one generation is to be kept, the new version of the table will be stored before the old space is released.

When stored, newly defined tables are automatically stored on the first library in the LIB-LIST (as set by the ML command) at the time of definition.

tableBASE does not permit a store of a newly defined table if the library contains a table with the same name. This prevents the inadvertent replacement of a previously defined table.

A table that has been read from a library will be stored into the library from which it was obtained, unless intentionally diverted by a DV or DW command.

Exceptions

None

See also

Divert (Non-existing) Table (DV)

Divert (Existing) Table (DW)