Setting Up History Tables

The primary data tables use the record 'creates', 'modifies', and 'deletes' from the mainframe to build an exact duplicate of host datasets.

A history table, on the other hand, treats all 'creates', 'modifies', and 'deletes', as new records to insert, even though a history table is structured similarly to a primary data table. In effect, the history table becomes another log or record of mainframe changes.

History tables are usually enabled as a device to feed data warehouse applications. History tables will continue to grow as DATABridge replicates data, so you should purge them regularly after successful updates to the data warehouse.

To enable history tables, set DSOPT_Save_Updates (bit mask 8 of ds_options in the DATASETS client control table). You must enable history tables before you generate DATABridge Client scripts, as explained in the next section. If you want to set this bit for a data set you can use the configuration parameter history_tables and set it to 1.

Each history table is named the same name as the corresponding primary data table with "_h" appended to the end.

It is also possible to create only history tables for a data set or for all data sets. To do this for all data sets, simple set the history_tables parameter to 2 in the configuration file. This will cause the ds_options bit DSOPT_History_Only (8192) to be set for all data sets. If you only want to do this for a few data sets, then you can use script.user_layout.dataset user script to do this.

Caution: When setting bits in ds_options, beware that some bits may already be set. You should use the "|" operator for SQL Server and the "+" operator for Oracle to set a bit rather than setting the column to that value.