Exchanging data between a base table and clone table

You can exchange table data and index data between the base table and clone table by using the EXCHANGE statement.

Procedure

Begin general-use programming interface information.
To exchange data between the base table and clone table:

Issue an EXCHANGE statement with the DATA BETWEEN TABLE table-name1 AND table-name2 syntax.

Start of changeExchanging data between the base table and the clone table does not invalidate packages.End of change

Example

EXCHANGE DATA BETWEEN TABLE table-name1 AND table-name2
End general-use programming interface information.

What to do next

After a data exchange, the base and clone table names remain the same as they were prior to the data exchange. No data movement actually takes place. The instance numbers in the underlying VSAM data sets for the objects (tables and indexes) do change, and this has the effect of changing the data that appears in the base and clone tables and their indexes. For example, a base table exists with the data set name *I0001.*. The table is cloned and the clone's data set is initially named *.I0002.*. After an exchange, the base objects are named *.I0002.* and the clones are named *I0001.*. Each time that an exchange happens, the instance numbers that represent the base and the clone objects change, which immediately changes the data contained in the base and clone tables and indexes.